Skip gnat.dg/prot7.adb on hppa.
[official-gcc.git] / libgomp / testsuite / libgomp.oacc-fortran / acc_on_device-1-3.f
blob5f500c19481330ffebf74a24538de9c904054687
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
11 ! the libgomp library function? The command line option
12 ! '-fno-builtin-acc_on_device' is valid for C/C++/ObjC/ObjC++ but not
13 ! for Fortran.
15 IMPLICIT NONE
16 INCLUDE "openacc_lib.h"
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