Files
clang-p2996/openmp/libomptarget/test/offloading/fortran/target-region-implicit-array.f90
Fabian Mora 12250c4092 Reland [OpenMP][Fix] libomptarget Fortran tests (#76189)
This patch fixes the erroneous multiple-target requirement in Fortran
offloading tests. Additionally, it adds two new variables
(test_flags_clang, test_flags_flang) to lit.cfg so that
compiler-specific flags for Clang and Flang can be specified.

This patch re-lands: #74543. The error was caused by having:
```
config.substitutions.append(("%flags", config.test_flags))
config.substitutions.append(("%flags_clang", config.test_flags_clang))
config.substitutions.append(("%flags_flang", config.test_flags_flang))
```
when instead it has to be:
```
config.substitutions.append(("%flags_clang", config.test_flags_clang))
config.substitutions.append(("%flags_flang", config.test_flags_flang))
config.substitutions.append(("%flags", config.test_flags))
```
because LIT replaces with the first longest sub-string match.
2023-12-21 14:18:36 -08:00

26 lines
614 B
Fortran

! Basic offloading test of a regular array explicitly
! passed within a target region
! REQUIRES: flang
! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
! UNSUPPORTED: aarch64-unknown-linux-gnu
! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
! UNSUPPORTED: x86_64-pc-linux-gnu
! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
! RUN: %libomptarget-compile-fortran-run-and-check-generic
program main
integer :: x(10) = (/0,0,0,0,0,0,0,0,0,0/)
integer :: i = 1
integer :: j = 11
!$omp target
do i = 1, j
x(i) = i;
end do
!$omp end target
PRINT *, x(:)
end program main
! CHECK: 1 2 3 4 5 6 7 8 9 10