Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / openmp / libomptarget / test / offloading / fortran / basic-target-region-1D-array-section.f90
blob58f5379e330ec030bf445d24f62a53db0381fca3
1 ! Basic offloading test of arrays with provided lower
2 ! and upper bounds as specified by OpenMP's sectioning
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 implicit none
14 integer :: write_arr(10) = (/0,0,0,0,0,0,0,0,0,0/)
15 integer :: read_arr(10) = (/1,2,3,4,5,6,7,8,9,10/)
16 integer :: i = 2
17 integer :: j = 5
18 !$omp target map(to:read_arr(2:5)) map(from:write_arr(2:5)) map(to:i,j)
19 do while (i <= j)
20 write_arr(i) = read_arr(i)
21 i = i + 1
22 end do
23 !$omp end target
25 print *, write_arr(:)
26 end program
28 ! CHECK: 0 2 3 4 5 0 0 0 0 0