summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/declare_reduction_messages.c
diff options
context:
space:
mode:
authorJordan Rupprecht <rupprecht@google.com>2019-05-14 21:58:59 +0000
committerJordan Rupprecht <rupprecht@google.com>2019-05-14 21:58:59 +0000
commitb35a2aa71f76a334a9c98c0a3c3995b5d902d2b9 (patch)
treecdff4a5d1a715d4ad622fd8f190128b54bebe440 /test/OpenMP/declare_reduction_messages.c
parent3748d41833787fcbf59cc5624e8d2b042a8991bc (diff)
parent741e05796da92b46d4f7bcbee00702ff37df6489 (diff)
Creating branches/google/stable and tags/google/stable/2019-05-14 from r360103upstream/google/stable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/google/stable@360714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/declare_reduction_messages.c')
-rw-r--r--test/OpenMP/declare_reduction_messages.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/OpenMP/declare_reduction_messages.c b/test/OpenMP/declare_reduction_messages.c
index 39387c795a..27e9e6e2e2 100644
--- a/test/OpenMP/declare_reduction_messages.c
+++ b/test/OpenMP/declare_reduction_messages.c
@@ -41,7 +41,17 @@ int temp; // expected-note 6 {{'temp' declared here}}
#pragma omp declare reduction(fun8 : long : omp_out += omp_in) initializer(omp_priv = 23)) // expected-warning {{extra tokens at the end of '#pragma omp declare reduction' are ignored}} expected-error {{redefinition of user-defined reduction for type 'long'}}
#pragma omp declare reduction(fun9 : long : omp_out += omp_in) initializer(omp_priv = ) // expected-error {{expected expression}}
+struct S {
+ int s;
+};
+#pragma omp declare reduction(+: struct S: omp_out.s += omp_in.s) // initializer(omp_priv = { .s = 0 })
+
int fun(int arg) {
+ struct S s;// expected-note {{'s' defined here}}
+ s.s = 0;
+#pragma omp parallel for reduction(+ : s) // expected-error {{list item of type 'struct S' is not valid for specified reduction operation: unable to provide default initialization value}}
+ for (arg = 0; arg < 10; ++arg)
+ s.s += arg;
#pragma omp declare reduction(red : int : omp_out++)
{
#pragma omp declare reduction(red : int : omp_out++) // expected-note {{previous definition is here}}