summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/cancel-parallel-1.C
diff options
context:
space:
mode:
Diffstat (limited to 'libgomp/testsuite/libgomp.c++/cancel-parallel-1.C')
-rw-r--r--libgomp/testsuite/libgomp.c++/cancel-parallel-1.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/libgomp/testsuite/libgomp.c++/cancel-parallel-1.C b/libgomp/testsuite/libgomp.c++/cancel-parallel-1.C
new file mode 100644
index 00000000000..033d676b3b2
--- /dev/null
+++ b/libgomp/testsuite/libgomp.c++/cancel-parallel-1.C
@@ -0,0 +1,18 @@
+// { dg-do run }
+// { dg-set-target-env-var OMP_CANCELLATION "true" }
+
+#include <omp.h>
+#include "cancel-test.h"
+
+int
+main ()
+{
+ #pragma omp parallel num_threads (32)
+ {
+ S a;
+ #pragma omp cancel parallel
+ if (omp_get_cancellation ())
+ abort ();
+ }
+ S::verify ();
+}