Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gfortran.dg / array_temporaries_2.f90
blob86e0a45e712b900222e15e083a299434de9131d9
1 ! { dg-do run }
2 ! { dg-options "-fcheck-array-temporaries" }
3 program test
4 implicit none
5 integer :: a(3,3)
6 call foo(a(:,1)) ! OK, no temporary created
7 call foo(a(1,:)) ! BAD, temporary var created
8 contains
9 subroutine foo(x)
10 integer :: x(3)
11 x = 5
12 end subroutine foo
13 end program test
15 ! { dg-output "At line 7 of file .*array_temporaries_2.f90(\n|\r\n|\r)Fortran runtime warning: An array temporary was created for argument 'x' of procedure 'foo'" }