Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libomptarget / test / offloading / fortran / basic-target-region-array.f90
blobd3c799ff3334f4d1856d08d29acf800a61b73c1a
1 ! Basic offloading test of a regular array explicitly
2 ! passed within a target region
3 ! REQUIRES: flang, amdgcn-amd-amdhsa
4 ! UNSUPPORTED: nvptx64-nvidia-cuda
5 ! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
6 ! UNSUPPORTED: aarch64-unknown-linux-gnu
7 ! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO
8 ! UNSUPPORTED: x86_64-pc-linux-gnu
9 ! UNSUPPORTED: x86_64-pc-linux-gnu-LTO
11 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
12 program main
13 integer :: x(10) = (/0,0,0,0,0,0,0,0,0,0/)
14 integer :: i = 1
15 integer :: j = 11
17 !$omp target map(tofrom:x, i, j)
18 do while (i <= j)
19 x(i) = i;
20 i = i + 1
21 end do
22 !$omp end target
24 PRINT *, x(:)
25 end program main
27 ! CHECK: 1 2 3 4 5 6 7 8 9 10