Files
clang-p2996/flang/test/Driver/fveclib-codegen.f90
Tom Eccles a207e6307a [flang] add fveclib flag (#71734)
-fveclib= allows users to choose a vectorized libm so that loops
containing math functions are vectorized.

This is implemented as much as possible in the same way as in clang. The
driver test in veclib.f90 is copied from the clang test.
2023-11-13 10:04:50 +00:00

16 lines
448 B
Fortran

! test that -fveclib= is passed to the backend
! -target aarch64 so that ArmPL is available
! RUN: %flang -S -Ofast -fveclib=LIBMVEC -o - %s | FileCheck %s
! RUN: %flang -S -Ofast -fveclib=NoLibrary -o - %s | FileCheck %s --check-prefix=NOLIB
subroutine sb(a, b)
real :: a(:), b(:)
integer :: i
do i=1,100
! check that we used a vectorized call to powf()
! CHECK: _ZGVbN4vv_powf
! NOLIB: powf
a(i) = a(i) ** b(i)
end do
end subroutine