Debian Codegraph @

gcc/testsuite/gfortran.dg/directive_unroll_5.f90

raw
1 ! { dg-do compile }
2
3 ! Test that
4 ! #pragma GCC unroll n
5 ! rejects invalid n and improper use
6
7 subroutine wrong1(n)
8 implicit NONE
9 integer (kind=1), intent(in) :: n
10 integer (kind=4) :: i
11 !GCC$ unroll 999999999 ! { dg-error "non-negative integral constant less than" }
12 DO i=0, n, 1
13 call dummy1(i)
14 ENDDO
15 end subroutine wrong1
16
17 subroutine wrong2(a, b, n)
18 implicit NONE
19 integer (kind=1), intent(in) :: n
20 integer :: a(n), b(n)
21 integer (kind=4) :: i
22 !GCC$ unroll -1 ! { dg-error "non-negative integral constant less than" }
23 DO i=1, n, 2
24 call dummy2(a(i), b(i), i)
25 ENDDO
26 end subroutine wrong2
27
28 subroutine wrong3(a, b, n)
29 implicit NONE
30 integer (kind=1), intent(in) :: n
31 integer :: a(n), b(n)
32 integer (kind=4) :: i
33 !GCC$ unroll 8
34 write (*,*) "wrong"! { dg-error "directive not at the start of a loop" }
35 DO i=n, 1, -1
36 call dummy2(a(i), b(i), i)
37 ENDDO
38 end subroutine wrong3