gcc.c-torture/execute/builtins/fputs.c: fputs_unlocked prototype
[official-gcc.git] / libgomp / testsuite / libgomp.c / address-space-1.c
blob39ff82c1429a2c5ac8e8d0b0284146120b08e5b3
1 /* Verify OMP instances of variables with address space. */
3 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
4 /* { dg-require-effective-target offload_device_nonshared_as } */
6 #include <assert.h>
8 int __seg_fs a;
10 int
11 main (void)
13 // a = 123; // SIGSEGV
14 int b;
15 #pragma omp target map(alloc: a) map(from: b)
17 a = 321; // no SIGSEGV (given 'offload_device_nonshared_as')
18 asm volatile ("" : : "g" (&a) : "memory");
19 b = a;
21 assert (b == 321);
23 return 0;