95 lines · plain
1! Testing the Semantics of loop sequences combined with 2! nested Loop Transformation Constructs3 4!RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=605 6subroutine loop_transformation_construct17 implicit none8 9 !$omp do10 !ERROR: OpenMP loop construct should contain a DO-loop or a loop-nest-generating OpenMP construct11 !$omp fuse 12end subroutine13 14subroutine loop_transformation_construct215 implicit none16 17 !$omp do18 !ERROR: OpenMP loop construct should contain a DO-loop or a loop-nest-generating OpenMP construct19 !$omp fuse 20 !$omp end fuse21end subroutine22 23subroutine loop_transformation_construct324 implicit none25 integer, parameter :: i = 526 integer :: x27 integer :: v(i)28 29 !$omp do30 !$omp fuse31 do x = 1, i32 v(x) = v(x) * 233 end do34 do x = 1, i35 v(x) = v(x) * 236 end do37 !$omp end fuse38 !$omp end do39 !ERROR: Misplaced OpenMP end-directive40 !$omp end fuse41end subroutine42 43subroutine loop_transformation_construct444 implicit none45 integer, parameter :: i = 546 integer :: x47 integer :: v(i)48 49 !$omp do50 do x = 1, i51 v(x) = v(x) * 252 end do53 !ERROR: OpenMP loop construct should contain a DO-loop or a loop-nest-generating OpenMP construct54 !$omp fuse55 !$omp end fuse56end subroutine57 58subroutine loop_transformation_construct559 implicit none60 integer, parameter :: i = 561 integer :: x62 integer :: v(i)63 64 !$omp do65 !ERROR: OpenMP loop construct cannot apply to a fully unrolled loop66 !$omp fuse67 !$omp unroll full68 do x = 1, i69 v(x) = v(x) * 270 end do71 do x = 1, i72 v(x) = v(x) * 273 end do74 !$omp end fuse75end subroutine76 77subroutine loop_transformation_construct678 implicit none79 integer, parameter :: i = 580 integer :: x81 integer :: v(i)82 83 !ERROR: The loop sequence following the DO construct must be fully fused first.84 !$omp do85 !$omp fuse looprange(1,1)86 !$omp unroll partial(2)87 do x = 1, i88 v(x) = v(x) * 289 end do90 do x = 1, i91 v(x) = v(x) * 292 end do93 !$omp end fuse 94end subroutine95