xfail scan-tree-dump-not throw in g++.dg/pr99966.C on hppa*64*-*-*
[official-gcc.git] / libgomp / testsuite / libgomp.c-c++-common / requires-5.c
blobd43d78db6fab61cdc34804a3adf38245576f5bf5
1 /* { dg-additional-options "-foffload-options=nvptx-none=-misa=sm_35" { target { offload_target_nvptx } } } */
2 /* { dg-additional-sources requires-5-aux.c } */
4 /* Depending on offload device capabilities, it may print something like the
5 following (only) if GOMP_DEBUG=1:
6 "devices present but 'omp requires unified_address, unified_shared_memory, reverse_offload' cannot be fulfilled"
7 and in that case does host-fallback execution.
9 As no offload devices support USM at present, we may verify host-fallback
10 execution by absence of separate memory spaces. */
12 #pragma omp requires unified_shared_memory, unified_address, reverse_offload
14 int a[10] = { 0 };
15 extern void foo (void);
17 int
18 main (void)
20 #pragma omp target map(to: a)
21 for (int i = 0; i < 10; i++)
22 a[i] = i;
24 for (int i = 0; i < 10; i++)
25 if (a[i] != i)
26 __builtin_abort ();
28 foo ();
29 return 0;