Skip to content

Commit

Permalink
Add a reproducer for internal issue llvm#48.
Browse files Browse the repository at this point in the history
  • Loading branch information
timcramer committed Jul 9, 2019
1 parent a6d4b7e commit de62872
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions clang/tools/sotoc/test/target/multiple_regions2.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// RUN: %sotoc-transform-compile
// RUN: %run-on-host | %filecheck %s

#include <stdio.h>

int main() {

int i = 0;
int j = 0;

#pragma omp target
{

#pragma omp parallel for private(j)
for(i=0; i<42; i++)
{
for(i=0; i<42; i++){}
}

#pragma omp parallel for
for(i=0; i<42; i++)
{
#pragma omp atomic
j++;
}

printf("%d\n", j);
fflush(0);
}

return 0;
}

// CHECK: 42

0 comments on commit de62872

Please sign in to comment.