aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c')
-rw-r--r--libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c b/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c
new file mode 100644
index 00000000000..77aa57a4c25
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c/examples-4/task_dep-4.c
@@ -0,0 +1,20 @@
+/* { dg-do run } */
+
+#include <stdlib.h>
+int main()
+{
+ int x = 1;
+ #pragma omp parallel
+ #pragma omp single
+ {
+ #pragma omp task shared(x) depend(out: x)
+ x = 2;
+ #pragma omp task shared(x) depend(in: x)
+ if (x != 2)
+ abort ();
+ #pragma omp task shared(x) depend(in: x)
+ if (x != 2)
+ abort ();
+ }
+ return 0;
+}