Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / oldparam01.f90
bloba26db3c045fb1d2e54b41c4e0567e667667a1171
1 ! RUN: %flang_fc1 -falternative-parameter-statement -fdebug-dump-symbols %s 2>&1 | FileCheck %s
3 ! Non-error tests for "old style" PARAMETER statements
5 type :: t
6 integer(kind=4) :: n
7 end type
8 !CHECK: x1, PARAMETER size=4 offset=0: ObjectEntity type: INTEGER(4) init:1_4
9 parameter x1 = 1_4 ! integer scalar
10 !CHECK: x2, PARAMETER size=4 offset=4: ObjectEntity type: INTEGER(4) shape: 1_8:1_8 init:[INTEGER(4)::2_4]
11 parameter x2 = [2_4] ! integer vector
12 !CHECK: x3, PARAMETER size=4 offset=8: ObjectEntity type: TYPE(t) init:t(n=3_4)
13 parameter x3 = t(3) ! derived scalar
14 !CHECK: x4, PARAMETER size=8 offset=12: ObjectEntity type: TYPE(t) shape: 1_8:2_8 init:[t::t(n=4_4),t(n=5_4)]
15 parameter x4 = [t(4), t(5)] ! derived vector
16 !CHECK: x5, PARAMETER size=3 offset=20: ObjectEntity type: CHARACTER(3_8,1) init:"abc"
17 parameter x5 = 1_"abc" ! character scalar
18 !CHECK: x6, PARAMETER size=12 offset=23: ObjectEntity type: CHARACTER(4_8,1) shape: 1_8:3_8 init:[CHARACTER(KIND=1,LEN=4)::"defg","h ","ij "]
19 parameter x6 = [1_"defg", 1_"h", 1_"ij"] ! character scalar
20 !CHECK: x7, PARAMETER size=4 offset=36: ObjectEntity type: INTEGER(4) init:5_4
21 !CHECK: x8, PARAMETER size=4 offset=40: ObjectEntity type: INTEGER(4) init:4_4
22 parameter x7 = 2+3, x8 = 4 ! folding, multiple definitions
23 !CHECK: x9, PARAMETER size=4 offset=44: ObjectEntity type: LOGICAL(4) init:.true._4
24 parameter x9 = .true.
25 end