xref: /llvm-project/offload/test/offloading/fortran/constant-arr-index.f90 (revision 372344995568cae076477a8b0e98fcdec7c49379)
1! Basic offloading test with a target region that checks constant indexing on
2! device correctly works (regression test for prior bug).
3! REQUIRES: flang, amdgpu
4
5! RUN: %libomptarget-compile-fortran-run-and-check-generic
6program main
7    INTEGER :: sp(10) = (/0,0,0,0,0,0,0,0,0,0/)
8
9  !$omp target map(tofrom:sp)
10     sp(1) = 20
11     sp(5) = 10
12  !$omp end target
13
14   print *, sp(1)
15   print *, sp(5)
16end program
17
18! CHECK: 20
19! CHECK: 10
20