[Openmp-commits] [openmp] [openmp] Fix bug63197.c test with 3 cores (PR #183269)
Nikita Popov via Openmp-commits
openmp-commits at lists.llvm.org
Wed Feb 25 02:13:25 PST 2026
https://github.com/nikic created https://github.com/llvm/llvm-project/pull/183269
This test assumes that the number of available threads is not 3, otherwise `#pragma omp parallel` and `#pragma omp parallel num_thread(3)` are naturally going to do the same thing.
Add a check against `omp_get_max_threads()` and PASS the test in that case.
>From 999a6849c2ab34350aea51e3912fa72907d7e701 Mon Sep 17 00:00:00 2001
From: Nikita Popov <npopov at redhat.com>
Date: Wed, 25 Feb 2026 11:11:18 +0100
Subject: [PATCH] [openmp] Fix bug63197.c test with 3 cores
This test assumes that the number of available threads is not 3,
otherwise `#pragma omp parallel` and `#pragma omp parallel
num_thread(3)` are naturally going to do the same thing.
Add a check against `omp_get_max_threads()` and PASS the test in
that case.
---
openmp/runtime/test/parallel/bug63197.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/openmp/runtime/test/parallel/bug63197.c b/openmp/runtime/test/parallel/bug63197.c
index c60f400b19a8f..a8367b4a15cc3 100644
--- a/openmp/runtime/test/parallel/bug63197.c
+++ b/openmp/runtime/test/parallel/bug63197.c
@@ -8,6 +8,13 @@ int main(int argc, char *argv[]) {
#pragma omp single
{ printf("BBB %2d\n", omp_get_num_threads()); }
+ // This test relies on the number of available threads
+ // being something other than 3.
+ if (omp_get_max_threads() == 3) {
+ printf("PASS\n");
+ return 0;
+ }
+
#pragma omp parallel
#pragma omp single
{
More information about the Openmp-commits
mailing list