1 /* { dg-do compile } */ 2 /* { dg-options "-fopenmp" } */ 3 4 #pragma omp declare reduction (| : long int : omp_out |= omp_in) /* { dg-error "predeclared arithmetic type" } */ 5 #pragma omp declare reduction (+ : char : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */ 6 typedef short T; 7 #pragma omp declare reduction (min : T : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */ 8 #pragma omp declare reduction (* : _Complex double : omp_out *= omp_in) /* { dg-error "predeclared arithmetic type" } */ 9 10 void foo(void)11foo (void) 12 { 13 #pragma omp declare reduction (| : long int : omp_out |= omp_in) /* { dg-error "predeclared arithmetic type" } */ 14 #pragma omp declare reduction (+ : char : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */ 15 #pragma omp declare reduction (min : T : omp_out += omp_in) /* { dg-error "predeclared arithmetic type" } */ 16 #pragma omp declare reduction (* : _Complex double : omp_out *= omp_in) /* { dg-error "predeclared arithmetic type" } */ 17 } 18 19 #pragma omp declare reduction (| : __typeof (foo) : omp_out |= omp_in) /* { dg-error "function or array" } */ 20 #pragma omp declare reduction (+ : char () : omp_out += omp_in) /* { dg-error "function or array" } */ 21 #pragma omp declare reduction (min : T[2] : omp_out += omp_in) /* { dg-error "function or array" } */ 22 23 void bar(void)24bar (void) 25 { 26 #pragma omp declare reduction (| : __typeof (foo) : omp_out |= omp_in)/* { dg-error "function or array" } */ 27 #pragma omp declare reduction (+ : char () : omp_out += omp_in) /* { dg-error "function or array" } */ 28 #pragma omp declare reduction (min : T[2] : omp_out += omp_in) /* { dg-error "function or array" } */ 29 } 30 31 struct A { int a; }; 32 #pragma omp declare reduction (| : const struct A : omp_out.a |= omp_in.a) /* { dg-error "const, volatile or restrict" } */ 33 #pragma omp declare reduction (+ : __const struct A : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */ 34 typedef volatile struct A T2; 35 #pragma omp declare reduction (min : T2 : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */ 36 #pragma omp declare reduction (* : struct A *__restrict : omp_out->a *= omp_in->a)/* { dg-error "const, volatile or restrict" } */ 37 38 void baz(void)39baz (void) 40 { 41 #pragma omp declare reduction (| : const struct A : omp_out.a |= omp_in.a) /* { dg-error "const, volatile or restrict" } */ 42 #pragma omp declare reduction (+ : __const struct A : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */ 43 typedef volatile struct A T3; 44 #pragma omp declare reduction (min : T3 : omp_out.a += omp_in.a) /* { dg-error "const, volatile or restrict" } */ 45 #pragma omp declare reduction (* : struct A *__restrict : omp_out->a *= omp_in->a)/* { dg-error "const, volatile or restrict" } */ 46 } 47