summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/dependency_48.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/dependency_48.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/dependency_48.f9026
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/dependency_48.f90 b/gcc/testsuite/gfortran.dg/dependency_48.f90
new file mode 100644
index 0000000000..64700193f7
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dependency_48.f90
@@ -0,0 +1,26 @@
+! { dg-do compile }
+! { dg-options "-frepack-arrays -Warray-temporaries -O" }
+
+! Same as dependency_35 but with repack-arrays
+
+module foo
+ implicit none
+contains
+ pure function bar(i,j) ! { dg-warning "Creating array temporary at \\(1\\)" }
+ integer, intent(in) :: i,j
+ integer, dimension(2,2) :: bar
+ bar = 33
+ end function bar
+end module foo
+
+program main
+ use foo
+ implicit none
+ integer a(2,2), b(2,2),c(2,2), d(2,2), e(2)
+
+ read (*,*) b, c, d
+ a = matmul(b,c) + d
+ a = b + bar(3,4)
+ a = bar(3,4)*5 + b
+ e = sum(b,1) + 3
+end program main