summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/teams_distribute_collapse_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/OpenMP/teams_distribute_collapse_messages.cpp')
-rw-r--r--clang/test/OpenMP/teams_distribute_collapse_messages.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/clang/test/OpenMP/teams_distribute_collapse_messages.cpp b/clang/test/OpenMP/teams_distribute_collapse_messages.cpp
index e21eab28c30..9ce58e0b065 100644
--- a/clang/test/OpenMP/teams_distribute_collapse_messages.cpp
+++ b/clang/test/OpenMP/teams_distribute_collapse_messages.cpp
@@ -1,8 +1,13 @@
// RUN: %clang_cc1 -verify -fopenmp %s
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++98
+// RUN: %clang_cc1 -verify -fopenmp %s -std=c++11
void foo() {
}
+#if __cplusplus >= 201103L
+// expected-note@+2 4 {{declared here}}
+#endif
bool foobool(int argc) {
return argc;
}
@@ -50,6 +55,9 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute', but found only 1}}
+#if __cplusplus >= 201103L
+// expected-note@+6 2 {{non-constexpr function 'foobool' cannot be used}}
+#endif
// expected-error@+4 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
@@ -62,7 +70,11 @@ T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
for (int i = ST; i < N; i++)
argv[0][i] = argv[0][i] - argv[0][i-ST];
-// expected-error@+2 2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+// expected-error@+5 2 {{integral constant expression must have integral or unscoped enumeration type}}
+#else
+// expected-error@+3 2 {{expression is not an integral constant expression}}
+#endif
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = ST; i < N; i++)
@@ -110,11 +122,17 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute', but found only 1}}
+#if __cplusplus >= 201103L
+// expected-note@+3 {{non-constexpr function 'foobool' cannot be used}}
+#endif
#pragma omp target
#pragma omp teams distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
+#if __cplusplus >= 201103L
+// expected-note@+6 {{non-constexpr function 'foobool' cannot be used}}
+#endif
// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
@@ -128,7 +146,11 @@ int main(int argc, char **argv) {
for (int i = 4; i < 12; i++)
argv[0][i] = argv[0][i] - argv[0][i-4];
-// expected-error@+2 {{expression is not an integral constant expression}}
+#if __cplusplus >= 201103L
+// expected-error@+5 {{integral constant expression must have integral or unscoped enumeration type}}
+#else
+// expected-error@+3 {{expression is not an integral constant expression}}
+#endif
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
for (int i = 4; i < 12; i++)
OpenPOWER on IntegriCloud