Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / acc_on_device-1-1.f90
blobcd599e5d0e3ac9945b342f0239f62f8454cad7a4
1 ! { dg-do run }
2 ! { dg-additional-options "-cpp" }
4 ! { dg-additional-options "-fopt-info-all-omp" }
5 ! { dg-additional-options "--param=openacc-privatization=noisy" }
6 ! { dg-additional-options "-foffload=-fopt-info-all-omp" }
7 ! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
8 ! for testing/documenting aspects of that functionality.
10 ! TODO: Have to disable the acc_on_device builtin for we want to test the
11 ! libgomp library function? The command line option
12 ! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not for
13 ! Fortran.
15 use openacc
16 implicit none
18 ! Host.
20 if (.not. acc_on_device (acc_device_none)) STOP 1
21 if (.not. acc_on_device (acc_device_host)) STOP 2
22 if (acc_on_device (acc_device_not_host)) STOP 3
23 if (acc_on_device (acc_device_nvidia)) STOP 4
24 if (acc_on_device (acc_device_radeon)) STOP 4
27 ! Host via offloading fallback mode.
29 !$acc parallel if(.false.)
30 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target *-*-* } .-1 }
31 !TODO Unhandled 'CONST_DECL' instances for constant arguments in 'acc_on_device' calls.
32 if (.not. acc_on_device (acc_device_none)) STOP 5
33 if (.not. acc_on_device (acc_device_host)) STOP 6
34 if (acc_on_device (acc_device_not_host)) STOP 7
35 if (acc_on_device (acc_device_nvidia)) STOP 8
36 if (acc_on_device (acc_device_radeon)) STOP 8
37 !$acc end parallel
40 #if !ACC_DEVICE_TYPE_host
42 ! Offloaded.
44 !$acc parallel
45 ! { dg-note {variable 'C\.[0-9]+' declared in block potentially has improper OpenACC privatization level: 'const_decl'} "TODO" { target { ! openacc_host_selected } } .-1 }
46 if (acc_on_device (acc_device_none)) STOP 9
47 if (acc_on_device (acc_device_host)) STOP 10
48 if (.not. acc_on_device (acc_device_not_host)) STOP 11
49 #if ACC_DEVICE_TYPE_nvidia
50 if (.not. acc_on_device (acc_device_nvidia)) STOP 12
51 #else
52 if (acc_on_device (acc_device_nvidia)) STOP 13
53 #endif
54 #if ACC_DEVICE_TYPE_radeon
55 if (.not. acc_on_device (acc_device_radeon)) STOP 14
56 #else
57 if (acc_on_device (acc_device_radeon)) STOP 15
58 #endif
59 !$acc end parallel
61 #endif
63 end