summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/parallel_sections_lastprivate_messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/OpenMP/parallel_sections_lastprivate_messages.cpp')
-rw-r--r--test/OpenMP/parallel_sections_lastprivate_messages.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/OpenMP/parallel_sections_lastprivate_messages.cpp b/test/OpenMP/parallel_sections_lastprivate_messages.cpp
index 10cc36e..af3c5e2 100644
--- a/test/OpenMP/parallel_sections_lastprivate_messages.cpp
+++ b/test/OpenMP/parallel_sections_lastprivate_messages.cpp
@@ -16,7 +16,7 @@ public:
S2() : a(0) {}
S2(S2 &s2) : a(s2.a) {}
const S2 &operator=(const S2 &) const;
- static float S2s;
+ static float S2s; // expected-note {{static data member is predetermined as shared}}
static const float S2sc;
};
const float S2::S2sc = 0; // expected-note {{static data member is predetermined as shared}}
@@ -66,7 +66,7 @@ int foomain(int argc, char **argv) {
I e(4);
I g(5);
int i;
- int &j = i; // expected-note {{'j' defined here}}
+ int &j = i;
#pragma omp parallel sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
{
foo();
@@ -131,7 +131,7 @@ int foomain(int argc, char **argv) {
}
#pragma omp parallel shared(i)
#pragma omp parallel private(i)
-#pragma omp parallel sections lastprivate(j) // expected-error {{arguments of OpenMP clause 'lastprivate' cannot be of reference type}}
+#pragma omp parallel sections lastprivate(j)
{
foo();
}
@@ -158,7 +158,7 @@ int main(int argc, char **argv) {
S3 m;
S6 n(2);
int i;
- int &j = i; // expected-note {{'j' defined here}}
+ int &j = i;
#pragma omp parallel sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
{
foo();
@@ -220,7 +220,7 @@ int main(int argc, char **argv) {
{
foo();
}
-#pragma omp parallel sections lastprivate(S2::S2s)
+#pragma omp parallel sections lastprivate(S2::S2s) // expected-error {{shared variable cannot be lastprivate}}
{
foo();
}
@@ -262,7 +262,7 @@ int main(int argc, char **argv) {
{
foo();
}
-#pragma omp parallel sections lastprivate(j) // expected-error {{arguments of OpenMP clause 'lastprivate' cannot be of reference type}}
+#pragma omp parallel sections lastprivate(j)
{
foo();
}
@@ -274,5 +274,10 @@ int main(int argc, char **argv) {
{
foo();
}
+ static int r;
+#pragma omp parallel sections lastprivate(r) // OK
+ {
+ foo();
+ }
return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
}
OpenPOWER on IntegriCloud