summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test/tasking
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/test/tasking')
-rw-r--r--openmp/runtime/test/tasking/omp_task_depend_resize_hashmap.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/openmp/runtime/test/tasking/omp_task_depend_resize_hashmap.c b/openmp/runtime/test/tasking/omp_task_depend_resize_hashmap.c
new file mode 100644
index 00000000000..03f12b06dfe
--- /dev/null
+++ b/openmp/runtime/test/tasking/omp_task_depend_resize_hashmap.c
@@ -0,0 +1,38 @@
+// RUN: %libomp-compile && env KMP_ENABLE_TASK_THROTTLING=0 %libomp-run
+
+#include<omp.h>
+#include<stdlib.h>
+#include<string.h>
+
+// The first hashtable static size is 997
+#define NUM_DEPS 4000
+
+
+int main()
+{
+ int *deps = calloc(NUM_DEPS, sizeof(int));
+ int i;
+ int failed = 0;
+
+ #pragma omp parallel
+ #pragma omp master
+ {
+ for (i = 0; i < NUM_DEPS; i++) {
+ #pragma omp task firstprivate(i) depend(inout: deps[i])
+ {
+ deps[i] = 1;
+ }
+ #pragma omp task firstprivate(i) depend(inout: deps[i])
+ {
+ deps[i] = 2;
+ }
+ }
+ }
+
+ for (i = 0; i < NUM_DEPS; i++) {
+ if (deps[i] != 2)
+ failed++;
+ }
+
+ return failed;
+}
OpenPOWER on IntegriCloud