summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/array_constructor_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/array_constructor_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/array_constructor_1.f9017
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/array_constructor_1.f90 b/gcc/testsuite/gfortran.dg/array_constructor_1.f90
new file mode 100644
index 000000000..0ba8ba0d0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/array_constructor_1.f90
@@ -0,0 +1,17 @@
+! { dg-do run }
+! Check that [...] style array constructors work
+program bracket_array_constructor
+ implicit none
+ integer :: a(4), i
+
+ a = [ 1, 2, 3, 4 ]
+ do i = 1, size(a)
+ if (a(i) /= i) call abort()
+ end do
+
+ a = [ (/ 1, 2, 3, 4 /) ]
+ do i = 1, size(a)
+ if (a(i) /= i) call abort()
+ end do
+
+end program bracket_array_constructor