LLVM OpenMP
20.0.0git
runtime
test
barrier
llvm-issue-80664.c
Go to the documentation of this file.
1
// RUN: %libomp-compile
2
// RUN: env OMP_WAIT_POLICY=passive \
3
// RUN: KMP_FORKJOIN_BARRIER_PATTERN='linear,linear' %libomp-run
4
// RUN: env OMP_WAIT_POLICY=passive \
5
// RUN: KMP_FORKJOIN_BARRIER_PATTERN='tree,tree' %libomp-run
6
// RUN: env OMP_WAIT_POLICY=passive \
7
// RUN: KMP_FORKJOIN_BARRIER_PATTERN='hyper,hyper' %libomp-run
8
// RUN: env OMP_WAIT_POLICY=passive \
9
// RUN: KMP_FORKJOIN_BARRIER_PATTERN='dist,dist' %libomp-run
10
//
11
// LLVM ISSUE 80664: https://github.com/llvm/llvm-project/issues/80664
12
//
13
// Distributed barrier + OMP_WAIT_POLICY=passive hangs in library termination
14
// Reason: the resume logic in __kmp_free_team() was faulty and, when checking
15
// for sleep status, didn't look at correct location for distributed barrier.
16
17
#include <stdio.h>
18
#include <stdlib.h>
19
20
int
a
= 0;
21
22
void
test_omp_barrier
() {
23
#pragma omp parallel
24
{
25
#pragma omp task
26
{
27
#pragma omp atomic
28
a
++;
29
}
30
}
31
}
32
33
int
main
() {
34
test_omp_barrier
();
35
printf(
"a = %d\n"
,
a
);
36
return
EXIT_SUCCESS;
37
}
test_omp_barrier
void test_omp_barrier()
Definition:
llvm-issue-80664.c:22
a
int a
Definition:
llvm-issue-80664.c:20
main
int main()
Definition:
llvm-issue-80664.c:33
Generated on Wed Feb 5 2025 10:57:20 for LLVM OpenMP by
1.9.6