[Openmp-commits] [openmp] 375862b - [OpenMP] Fix the issue in openmp/runtime/test/parallel/bug63197.c

Shilei Tian via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 14 09:25:21 PDT 2023


Author: Shilei Tian
Date: 2023-06-14T12:23:37-04:00
New Revision: 375862b481d952add7510270dc0adaed04049b1b

URL: https://github.com/llvm/llvm-project/commit/375862b481d952add7510270dc0adaed04049b1b
DIFF: https://github.com/llvm/llvm-project/commit/375862b481d952add7510270dc0adaed04049b1b.diff

LOG: [OpenMP] Fix the issue in openmp/runtime/test/parallel/bug63197.c

If the system has 32 threads, then the test will fail because of partial match.

Added: 
    

Modified: 
    openmp/runtime/test/parallel/bug63197.c

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/test/parallel/bug63197.c b/openmp/runtime/test/parallel/bug63197.c
index bba21de43deb4..c60f400b19a8f 100644
--- a/openmp/runtime/test/parallel/bug63197.c
+++ b/openmp/runtime/test/parallel/bug63197.c
@@ -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


        


More information about the Openmp-commits mailing list