gcc/testsuite/gfortran.dg/gomp/pr77665.f90
raw| 1 | ! PR fortran/77665 |
| 2 | ! { dg-do compile } |
| 3 | ! { dg-additional-options "-O2" } |
| 4 | |
| 5 | program pr77665 |
| 6 | type t |
| 7 | integer :: a = 0 |
| 8 | end type |
| 9 | type(t) :: x |
| 10 | integer :: i |
| 11 | !$omp declare reduction (+:t: omp_out%a = omp_out%a + omp_in%a) |
| 12 | !$omp simd reduction(+:x) |
| 13 | do i = 1, 8 |
| 14 | if (abs(i) < 5) STOP 1 |
| 15 | x%a = x%a + 1 |
| 16 | end do |
| 17 | print *, x%a |
| 18 | end |