Debian Codegraph @

libgomp/testsuite/libgomp.c/target-55a.c

raw
1 /* { dg-do run { target { ! offload_device } } } */
2 /* { dg-set-target-env-var OMP_TARGET_OFFLOAD "mandatory" } */
3
4 /* Should fail - see target-55a.c for offload_device */
5
6 /* { dg-shouldfail "omp_invalid_device" } */
7 /* { dg-output ".*libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but only the host device is available.*" } */
8
9 /* Check OMP_TARGET_OFFLOAD - it shall run on systems with offloading
10 devices available and fail otherwise. Note that this did always
11 fail - as the device handling wasn't initialized before doing the
12 mandatory checking. */
13
14 int
15 main ()
16 {
17 int x = 1;
18 #pragma omp target map(tofrom: x)
19 x = 5;
20 if (x != 5)
21 __builtin_abort ();
22 return 0;
23 }