Skip to content

Commit de62872

Browse files
committed
Add a reproducer for internal issue llvm#48.
1 parent a6d4b7e commit de62872

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// RUN: %sotoc-transform-compile
2+
// RUN: %run-on-host | %filecheck %s
3+
4+
#include <stdio.h>
5+
6+
int main() {
7+
8+
int i = 0;
9+
int j = 0;
10+
11+
#pragma omp target
12+
{
13+
14+
#pragma omp parallel for private(j)
15+
for(i=0; i<42; i++)
16+
{
17+
for(i=0; i<42; i++){}
18+
}
19+
20+
#pragma omp parallel for
21+
for(i=0; i<42; i++)
22+
{
23+
#pragma omp atomic
24+
j++;
25+
}
26+
27+
printf("%d\n", j);
28+
fflush(0);
29+
}
30+
31+
return 0;
32+
}
33+
34+
// CHECK: 42

0 commit comments

Comments
 (0)