Author: probinson Date: Mon Dec 19 12:43:26 2016 New Revision: 290128 URL: http://llvm.org/viewvc/llvm-project?rev=290128&view=rev Log: Make a few OpenMP tests "C++11 clean."
This time trying to commit just the relevant 3 tests! Reviewed by abataev (in D27794) Modified: cfe/trunk/test/OpenMP/teams_distribute_collapse_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp Modified: cfe/trunk/test/OpenMP/teams_distribute_collapse_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_collapse_messages.cpp?rev=290128&r1=290127&r2=290128&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_collapse_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_collapse_messages.cpp Mon Dec 19 12:43:26 2016 @@ -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-n 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-n 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++) Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp?rev=290128&r1=290127&r2=290128&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_collapse_messages.cpp Mon Dec 19 12:43:26 2016 @@ -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-n 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 parallel for', 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 parallel for' 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-n 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 parallel for 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 parallel for', 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 parallel for 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 parallel for' 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 parallel for collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 4; i < 12; i++) Modified: cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp?rev=290128&r1=290127&r2=290128&view=diff ============================================================================== --- cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp (original) +++ cfe/trunk/test/OpenMP/teams_distribute_parallel_for_simd_collapse_messages.cpp Mon Dec 19 12:43:26 2016 @@ -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-n 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 parallel for simd', 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 parallel for simd' 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-n 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 parallel for simd 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 parallel for simd', 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 parallel for simd 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 parallel for simd' 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 parallel for simd collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} for (int i = 4; i < 12; i++) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits