summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/single_copyprivate_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/single_copyprivate_messages.cpp')
-rw-r--r--test/OpenMP/single_copyprivate_messages.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/OpenMP/single_copyprivate_messages.cpp b/test/OpenMP/single_copyprivate_messages.cpp
index f07ab12..7bb145c 100644
--- a/test/OpenMP/single_copyprivate_messages.cpp
+++ b/test/OpenMP/single_copyprivate_messages.cpp
@@ -155,3 +155,23 @@ int main(int argc, char **argv) {
return tmain(argc, argv); // expected-note {{in instantiation of function template specialization 'tmain<int, char>' requested here}}
}
+
+extern void abort(void);
+
+void
+single(int a, int b) {
+#pragma omp single copyprivate(a) copyprivate(b)
+ {
+ a = b = 5;
+ }
+
+ if (a != b)
+ abort();
+}
+
+int parallel() {
+#pragma omp parallel
+ single(1, 2);
+
+ return 0;
+}
OpenPOWER on IntegriCloud