]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgomp/testsuite/libgomp.c-c++-common/requires-4.c
OpenMP: Move omp requires checks to libgomp
[thirdparty/gcc.git] / libgomp / testsuite / libgomp.c-c++-common / requires-4.c
1 /* { dg-do link { target offloading_enabled } } */
2 /* { dg-additional-options "-flto" } */
3 /* { dg-additional-sources requires-4-aux.c } */
4
5 /* Check diagnostic by device-compiler's or host compiler's lto1.
6 Other file uses: 'requires reverse_offload', but that's inactive as
7 there are no declare target directives, device constructs nor device routines */
8
9 #pragma omp requires unified_address,unified_shared_memory
10
11 int a[10];
12 extern void foo (void);
13
14 int
15 main (void)
16 {
17 #pragma omp target
18 for (int i = 0; i < 10; i++)
19 a[i] = 0;
20
21 foo ();
22 return 0;
23 }