From d29445972065f54566402b255d76b2567e23d445 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 15 Nov 2021 08:54:52 +0100 Subject: [PATCH] libgomp: Add a testcase for omp_get_num_teams inside of target inside of host teams This is https://github.com/OpenMP/spec/issues/3183 There is an agreement that we should return 1 team inside of target, even if that target is inside of host teams. We were doing that when offloading and not during host fallback, r12-5151 should fix that even for host fallback. 2021-11-15 Jakub Jelinek * testsuite/libgomp.c/teams-5.c: New test. --- libgomp/testsuite/libgomp.c/teams-5.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libgomp/testsuite/libgomp.c/teams-5.c diff --git a/libgomp/testsuite/libgomp.c/teams-5.c b/libgomp/testsuite/libgomp.c/teams-5.c new file mode 100644 index 0000000..ad42e05 --- /dev/null +++ b/libgomp/testsuite/libgomp.c/teams-5.c @@ -0,0 +1,17 @@ +#include +#include + +int +main () +{ + #pragma omp teams num_teams (2) + { + if (omp_get_num_teams () != 2) + abort (); + #pragma omp parallel if (0) + #pragma omp target + if (omp_get_num_teams () != 1 || omp_get_team_num () != 0) + abort (); + } + return 0; +} -- 2.7.4