2 ! { dg-options "-std=f2008" }
4 ! Test for errors with implied-shape declarations.
6 ! Contributed by Daniel Kraft, d@domob.eu.
12 INTEGER, PARAMETER :: mat(2, 2) = RESHAPE ((/ 1, 2, 3, 4 /), (/ 2, 2 /))
14 ! Malformed declaration.
15 INTEGER, PARAMETER :: arr1(*, *, 5) = mat ! { dg-error "Bad array specification for implied-shape array" }
17 ! Rank mismatch in initialization.
18 INTEGER, PARAMETER :: arr2(*, *) = (/ 1, 2, 3, 4 /) ! { dg-error "Incompatible ranks" }
20 ! Non-PARAMETER implied-shape, with and without initializer.
21 INTEGER :: arr3(*, *) ! { dg-error "Non-PARAMETER" }
22 INTEGER :: arr4(*, *) = mat ! { dg-error "Non-PARAMETER" }
24 ! Missing initializer.
25 INTEGER, PARAMETER :: arr5(*) ! { dg-error "is missing an initializer" }
27 ! Initialization from scalar.
28 INTEGER, PARAMETER :: arr6(*) = 0 ! { dg-error "with scalar" }
33 INTEGER, PARAMETER :: arr7(n:*) = (/ 2, 3, 4 /) ! { dg-error "Non-constant lower bound" }