summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/array_constructor_46.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/array_constructor_46.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_46.f9015
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_46.f90 b/gcc/testsuite/gfortran.dg/array_constructor_46.f90
new file mode 100644
index 0000000000..471c6a86fb
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_46.f90
@@ -0,0 +1,15 @@
+! { dg-do run }
+! { dg-options "-ffrontend-optimize -fdump-tree-original" }
+! Test that nested array constructors are optimized.
+program main
+ implicit none
+ integer, parameter :: dp=selected_real_kind(15)
+ real(kind=dp), dimension(2,2) :: a
+ real(kind=dp) thirteen
+
+ data a /2._dp,3._dp,5._dp,7._dp/
+ thirteen = 13._dp
+ if (abs (product([[11._dp, thirteen], a]) - 30030._dp) > 1e-8) call abort
+end program main
+! { dg-final { scan-tree-dump-times "while" 2 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }