Debian Codegraph @

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

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