Skip to content

Commit

Permalink
[OpenMP] Fix the issue in openmp/runtime/test/parallel/bug63197.c
Browse files Browse the repository at this point in the history
If the system has 32 threads, then the test will fail because of partial match.
  • Loading branch information
shiltian committed Jun 14, 2023
1 parent debdf7e commit 375862b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions openmp/runtime/test/parallel/bug63197.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
#include <stdio.h>

int main(int argc, char *argv[]) {
#pragma omp parallel num_threads(3) if(0)
#pragma omp parallel num_threads(3) if (0)
#pragma omp single
{ printf("BBB %2d\n", omp_get_num_threads()); }

#pragma omp parallel
#pragma omp single
{ printf("CCC %2d\n", omp_get_num_threads()); }
{
if (omp_get_num_threads() != 3)
printf("PASS\n");
}
return 0;
}

// CHECK-NOT: CCC 3
// CHECK: PASS

0 comments on commit 375862b

Please sign in to comment.