repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR rtl-optimization/77919
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c++
/
declare_target-1.C
blob
4394bb1405dfaf7a773ae4c3380c05b2e289e0fb
1
// { dg-do run }
2
// { dg-require-effective-target offload_device_shared_as }
3
4
#include <stdlib.h>
5
6
struct typeX
7
{
8
int a;
9
};
10
11
class typeY
12
{
13
public:
14
int foo () { return a^0x01; }
15
int a;
16
};
17
18
#pragma omp declare target
19
struct typeX varX;
20
class typeY varY;
21
#pragma omp end declare target
22
23
int main ()
24
{
25
varX.a = 0;
26
varY.a = 0;
27
28
#pragma omp target
29
{
30
varX.a = 100;
31
varY.a = 100;
32
}
33
34
if (varX.a != 100 || varY.a != 100)
35
abort ();
36
37
return 0;
38
}