LLVM OpenMP
22.0.0git
runtime
test
env
check_certain_values.c
Go to the documentation of this file.
1
// RUN: %libomp-compile
2
// RUN: env KMP_FORKJOIN_BARRIER=0,0 %libomp-run
3
// RUN: env KMP_PLAIN_BARRIER=0,0 %libomp-run
4
// RUN: env KMP_REDUCTION_BARRIER=0,0 %libomp-run
5
// RUN: env KMP_ALIGN_ALLOC=7 %libomp-run
6
// RUN: env KMP_ALIGN_ALLOC=8 %libomp-run
7
// RUN: env KMP_AFFINITY='explicit,proclist=[0-1222333333333444444]' %libomp-run
8
// RUN: env KMP_AFFINITY=disabled OMP_DISPLAY_AFFINITY=TRUE %libomp-run
9
//
10
// Test that certain environment variable values do not crash the runtime.
11
#include <omp.h>
12
#include <stdlib.h>
13
14
int
a
= 0;
15
16
int
test
() {
17
#pragma omp parallel reduction(+ : a)
18
{
19
a
+= omp_get_thread_num();
20
}
21
if
(
a
== 0) {
22
// If the test passes, 'a' should not be zero
23
// because we are using reduction on thread numbers.
24
return
0;
25
}
26
return
1;
27
}
28
29
int
main
(
int
argc,
char
**argv) {
30
int
status
= EXIT_SUCCESS;
31
if
(!
test
()) {
32
status
= EXIT_FAILURE;
33
}
34
return
status
;
35
}
a
int a
Definition:
check_certain_values.c:14
test
int test()
Definition:
check_certain_values.c:16
status
static volatile kmp_i18n_cat_status_t status
Definition:
kmp_i18n.cpp:48
main
int main()
Definition:
test-touch.c:21
Generated on Tue Sep 2 2025 18:35:25 for LLVM OpenMP by
1.9.6