[RISCV] Simplify MIPS CCMov patterns. NFC (#125318)
[llvm-project.git] / offload / test / offloading / fortran / target-data-map-if-present.f90
blobc181573cd7a1c1efe7a9a1cbb9ae5988e299d5ae
1 ! Offloading test that tests that if(present(a)) compiles and executes without
2 ! causing any compilation errors, primarily a regression test that does not
3 ! yield interesting results.
4 ! REQUIRES: flang, amdgpu
6 ! RUN: %libomptarget-compile-fortran-run-and-check-generic
7 module mod
8 implicit none
9 contains
10 subroutine routine(a)
11 implicit none
12 real, dimension(:), optional :: a
13 integer :: i
14 !$omp target data if(present(a)) map(alloc:a)
15 do i = 1, 10
16 a(i) = i
17 end do
18 !$omp end target data
19 end subroutine routine
20 end module mod
22 program main
23 use mod
24 real :: a(10)
25 call routine(a)
26 print *, a
27 end program main
29 ! CHECK: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10.