Debian Codegraph @

libgomp/testsuite/libgomp.c/target-51.c

raw
1 /* Check OMP_TARGET_OFFLOAD on systems with no available non-host devices,
2 which is enforced by using -foffload=disable. */
3
4 /* { dg-do run } */
5 /* { dg-additional-options "-foffload=disable" } */
6 /* { dg-set-target-env-var OMP_TARGET_OFFLOAD "mandatory" } */
7
8 /* { dg-shouldfail "OMP_TARGET_OFFLOAD=mandatory and no available device" } */
9
10 /* See comment in target-50.c/target-50.c for why the output differs. */
11
12 /* { dg-output ".*libgomp: OMP_TARGET_OFFLOAD is set to MANDATORY, but .*" } */
13
14 int
15 main ()
16 {
17 int x;
18 #pragma omp target map(tofrom:x)
19 x = 5;
20 if (x != 5)
21 __builtin_abort ();
22 return 0;
23 }