Debian Codegraph @

libgomp/testsuite/libgomp.c++/pr108286.C

raw
1 // PR c++/108286
2 // { dg-do run }
3
4 struct S {
5 int
6 foo ()
7 {
8 int res = 0;
9 #pragma omp target map(size, ptr[:size], res) nowait
10 res = ptr[size - 1];
11 #pragma omp taskwait
12 return res;
13 }
14
15 unsigned size;
16 int *ptr;
17 };
18
19 int
20 main ()
21 {
22 S s;
23 int buf[5];
24 s.size = 5;
25 s.ptr = buf;
26 buf[4] = 42;
27 if (s.foo () != 42)
28 __builtin_abort ();
29 }