tree-optimization/113385 - wrong loop father with early exit vectorization
[official-gcc.git] / gcc / testsuite / gfortran.dg / gomp / udr1.f90
blob84601310c45c1b9692b13a8bc384ef996545ba16
1 ! { dg-do compile }
3 subroutine f1
4 !$omp declare reduction (.le.:integer:omp_out = omp_out + omp_in) ! { dg-error "Invalid operator for" }
5 end subroutine f1
6 subroutine f2
7 !$omp declare reduction (bar:real(kind=4):omp_out = omp_out + omp_in)
8 real(kind=4) :: r
9 integer :: i
10 r = 0.0
11 !$omp parallel do reduction (bar:r)
12 do i = 1, 10
13 r = r + i
14 end do
15 !$omp parallel do reduction (foo:r) ! { dg-error "foo not found" }
16 do i = 1, 10
17 r = r + i
18 end do
19 !$omp parallel do reduction (.gt.:r) ! { dg-error "cannot be used as a defined operator" }
20 do i = 1, 10
21 r = r + i
22 end do
23 end subroutine f2
24 subroutine f3
25 !$omp declare reduction (foo:blah:omp_out=omp_out + omp_in) ! { dg-error "Unclassifiable OpenMP directive" }
26 end subroutine f3
27 subroutine f4
28 !$omp declare reduction (foo:integer:a => null()) ! { dg-error "Invalid character in name" }
29 !$omp declare reduction (foo:integer:omp_out = omp_in + omp_out) &
30 !$omp & initializer(a => null()) ! { dg-error "Invalid character in name" }
31 end subroutine f4
32 subroutine f5
33 integer :: a, b
34 !$omp declare reduction (foo:integer:a = b + 1) ! { dg-error "Variable other than OMP_OUT or OMP_IN used in combiner" }
35 !$omp declare reduction (bar:integer:omp_out = omp_out * omp_in) &
36 !$omp & initializer(b = a + 1) ! { dg-error "Variable other than OMP_PRIV or OMP_ORIG used in INITIALIZER clause" }
37 end subroutine f5
38 subroutine f6
39 !$omp declare reduction (foo:integer:omp_out=omp_out+omp_in) &
40 !$omp & initializer(omp_orig=omp_priv)
41 end subroutine f6