Plugins: Add label-text.h to CPPLIB_H so it will be installed [PR115288]
[official-gcc.git] / gcc / testsuite / gfortran.dg / internal_pack_24.f90
blobcc2443edcc02b7dac2ae461dbbb9ceb9b1016f22
1 ! { dg-do run }
2 ! { dg-additional-options "-O -fdump-tree-optimized" }
3 module y
4 implicit none
5 contains
6 subroutine foo(a,b,c,d,e,f)
7 real, dimension(1), intent(inout) :: a, b, c, d, e, f
8 if (any([a,b,c,d,e,f] /= [1,2,3,4,5,6])) stop 1
9 a = -a
10 b = -b
11 c = -c
12 d = -d
13 e = -e
14 f = -f
15 end subroutine foo
16 end module y
17 module x
18 use y
19 implicit none
20 contains
21 subroutine bar(a)
22 real, dimension(:) :: a
23 integer :: n1, n3, n5
24 n1 = 1
25 n3 = 3
26 n5 = 5
27 call foo(a(n1:n1), a(n1+1:n1+1), a(n3:n3), a(n3+1:n3+1), a(n5:n5), a(n5+1:n5+1))
28 end subroutine bar
29 end module x
31 program main
32 use x
33 real, dimension(6) :: a,b
34 b = [1,2,3,4,5,6]
35 a = b
36 call bar(a)
37 if (any(a /= -b)) stop 2
38 end program main
39 ! { dg-final { scan-tree-dump-not "contiguous" "optimized" } }