diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-04 08:10:48 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-08-04 08:10:48 +0000 |
commit | 48977c3364d978b234734e6125adf39e55e9603d (patch) | |
tree | 39ffb3932dd3a68fccb89e689d318b59dccaa89b /clang/test/OpenMP/simd_linear_messages.cpp | |
parent | d19b9d82290abec6d4821876f012931ee1b2a932 (diff) | |
download | bcm5719-llvm-48977c3364d978b234734e6125adf39e55e9603d.tar.gz bcm5719-llvm-48977c3364d978b234734e6125adf39e55e9603d.zip |
[OPENMP] Fix compiler crash during data-sharing attributes analysis.
If a global variable is marked as private in OpenMP construct and then is used in of the private clauses of the same construct, it might cause compiler crash because of incorrect capturing.
llvm-svn: 243964
Diffstat (limited to 'clang/test/OpenMP/simd_linear_messages.cpp')
-rw-r--r-- | clang/test/OpenMP/simd_linear_messages.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/OpenMP/simd_linear_messages.cpp b/clang/test/OpenMP/simd_linear_messages.cpp index 78f905fd946..6fac26290b4 100644 --- a/clang/test/OpenMP/simd_linear_messages.cpp +++ b/clang/test/OpenMP/simd_linear_messages.cpp @@ -156,6 +156,7 @@ namespace C { using A::x; } +int f; int main(int argc, char **argv) { double darr[100]; // expected-note@+1 {{in instantiation of function template specialization 'test_template<-4, double, int>' requested here}} @@ -167,6 +168,8 @@ int main(int argc, char **argv) { S5 g(5); // expected-note {{'g' defined here}} int i; int &j = i; // expected-note {{'j' defined here}} + #pragma omp simd linear(f) linear(f) // expected-error {{linear variable cannot be linear}} expected-note {{defined as linear}} + for (int k = 0; k < argc; ++k) ++k; #pragma omp simd linear // expected-error {{expected '(' after 'linear'}} for (int k = 0; k < argc; ++k) ++k; #pragma omp simd linear ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} |