summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr81154.C
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2017-06-26 15:27:22 +0200
committerMartin Jambor <mjambor@suse.cz>2017-06-26 15:27:22 +0200
commit166bec868d991fdf71f9a66f994e5977fcab4aa2 (patch)
tree5e45be1a3236377b15a25666d5ad9e0a566aef8a /gcc/testsuite/g++.dg/gomp/pr81154.C
parent7f6e4303242a526871a02c003eb57257f7b25448 (diff)
parente76fa056805f0aeb36583a27b02f4a4adbfd0004 (diff)
downloadgcc-166bec868d991fdf71f9a66f994e5977fcab4aa2.tar.gz
Merge branch 'master' into gcn
Diffstat (limited to 'gcc/testsuite/g++.dg/gomp/pr81154.C')
-rw-r--r--gcc/testsuite/g++.dg/gomp/pr81154.C57
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/gomp/pr81154.C b/gcc/testsuite/g++.dg/gomp/pr81154.C
new file mode 100644
index 00000000000..dc0aec33e14
--- /dev/null
+++ b/gcc/testsuite/g++.dg/gomp/pr81154.C
@@ -0,0 +1,57 @@
+// PR c++/81154
+// { dg-do compile }
+
+template <typename T>
+struct C
+{
+ int foo (T n) const
+ {
+#pragma omp parallel shared (foo) // { dg-error "is not a variable in clause" }
+ ;
+#pragma omp parallel private (foo) // { dg-error "is not a variable in clause" }
+ ;
+#pragma omp parallel firstprivate (foo) // { dg-error "is not a variable in clause" }
+ ;
+#pragma omp parallel for lastprivate (foo) // { dg-error "is not a variable in clause" }
+ for (T i = 0; i < n; i++)
+ ;
+#pragma omp parallel for linear (foo) // { dg-error "is not a variable in clause" }
+ for (T i = 0; i < n; i++)
+ ;
+#pragma omp parallel reduction (+:foo) // { dg-error "is not a variable in clause" }
+ ;
+ return 0;
+ }
+ int foo (int x, int y) { return x; }
+};
+
+struct D
+{
+ typedef int T;
+ int foo (T n) const
+ {
+#pragma omp parallel shared (foo) // { dg-error "is not a variable in clause" }
+ ;
+#pragma omp parallel private (foo) // { dg-error "is not a variable in clause" }
+ ;
+#pragma omp parallel firstprivate (foo) // { dg-error "is not a variable in clause" }
+ ;
+#pragma omp parallel for lastprivate (foo) // { dg-error "is not a variable in clause" }
+ for (T i = 0; i < n; i++)
+ ;
+#pragma omp parallel for linear (foo) // { dg-error "is not a variable in clause" }
+ for (T i = 0; i < n; i++)
+ ;
+#pragma omp parallel reduction (+:foo) // { dg-error "is not a variable in clause" }
+ ;
+ return 0;
+ }
+ int foo (int x, int y) { return x; }
+};
+
+int
+main ()
+{
+ C<int> ().foo (1);
+ D ().foo (1);
+}