PR target/83368
[official-gcc.git] / gcc / testsuite / gfortran.dg / directive_unroll_4.f90
blobfbb5f24e76fbef834fcb6c03942ace09fd3fa823
1 ! { dg-do compile }
2 ! { dg-options "-O2 -funroll-all-loops -fdump-rtl-loop2_unroll-details -fdump-tree-cunrolli-details" }
3 ! Test that
4 ! #pragma GCC unroll n
5 ! works
7 subroutine test1(a)
8 implicit NONE
9 integer :: a(8)
10 integer (kind=4) :: i
11 !GCC$ unroll 0
12 DO i=1, 8, 1
13 call dummy(a(i))
14 ENDDO
15 end subroutine test1
17 subroutine test2(a, n)
18 implicit NONE
19 integer :: a(n)
20 integer (kind=1), intent(in) :: n
21 integer (kind=4) :: i
22 !GCC$ unroll 0
23 DO i=1, n, 1
24 call dummy(a(i))
25 ENDDO
26 end subroutine test2
28 ! { dg-final { scan-tree-dump "Not unrolling loop .: user didn't want it unrolled completely" "cunrolli" } } */
29 ! { dg-final { scan-rtl-dump-times "Not unrolling loop, user didn't want it unrolled" 2 "loop2_unroll" } } */