Skip to content

Commit 1be3831

Browse files
committed
Test case for static variables (see internal issue llvm#26).
1 parent 07ec398 commit 1be3831

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// RUN: %sotoc-transform-compile
2+
// RUN: %run-on-host | %filecheck %s
3+
4+
#include <stdio.h>
5+
6+
#pragma omp declare target
7+
static int a;
8+
#pragma omp end declare target
9+
10+
int main(){
11+
a = 42;
12+
#pragma omp target update to(a)
13+
#pragma omp target
14+
{
15+
printf("%d\n", a);
16+
}
17+
}
18+
19+
// CHECK: 42

0 commit comments

Comments
 (0)