[Instrumentation] Fix a warning
[llvm-project.git] / openmp / runtime / test / tasking / omp_task_depend_resize_hashmap.c
blob58cca562f59476b2b6fb65ec5ad8a3d51f6f8a0b
1 // RUN: %libomp-compile && env KMP_ENABLE_TASK_THROTTLING=0 %libomp-run
3 // This test is known to be fragile on NetBSD kernel at the moment,
4 // https://bugs.llvm.org/show_bug.cgi?id=42020.
5 // UNSUPPORTED: netbsd
7 // Very flaky on openmp-clang-x86_64-linux-debian.
8 // https://bugs.llvm.org/show_bug.cgi?id=45397
9 // UNSUPPORTED: linux
11 #include<omp.h>
12 #include<stdlib.h>
13 #include<string.h>
15 // The first hashtable static size is 997
16 #define NUM_DEPS 4000
19 int main()
21 int *deps = calloc(NUM_DEPS, sizeof(int));
22 int i;
23 int failed = 0;
25 #pragma omp parallel
26 #pragma omp master
28 for (i = 0; i < NUM_DEPS; i++) {
29 #pragma omp task firstprivate(i) depend(inout: deps[i])
31 deps[i] = 1;
33 #pragma omp task firstprivate(i) depend(inout: deps[i])
35 deps[i] = 2;
40 for (i = 0; i < NUM_DEPS; i++) {
41 if (deps[i] != 2)
42 failed++;
45 return failed;