[flang][openacc][NFC] Check only HLFIR lowering for atomic tests (#72922)
[llvm-project.git] / flang / test / Lower / array-expression-slice-1.f90
blobd7865a395db1c861f9d87b2cdd6548d754afe8e4
1 ! RUN: bbc -hlfir=false -o - --outline-intrinsics %s | FileCheck %s
3 ! CHECK-LABEL: func @_QQmain() attributes {fir.bindc_name = "p"} {
4 ! CHECK-DAG: %[[VAL_0:.*]] = arith.constant 10 : index
5 ! CHECK-DAG: %[[VAL_4:.*]] = arith.constant 2 : index
6 ! CHECK-DAG: %[[VAL_5:.*]] = arith.constant 1 : index
7 ! CHECK-DAG: %[[VAL_6:.*]] = arith.constant 0 : index
8 ! CHECK-DAG: %[[VAL_8:.*]] = arith.constant 8 : i64
9 ! CHECK-DAG: %[[VAL_11:.*]] = arith.constant 3 : index
10 ! CHECK-DAG: %[[VAL_13:.*]] = arith.constant 2 : i64
11 ! CHECK-DAG: %[[VAL_14:.*]] = arith.constant 7 : i64
12 ! CHECK-DAG: %[[VAL_16:.*]] = arith.constant 4 : i64
13 ! CHECK-DAG: %[[VAL_18:.*]] = arith.constant -1 : i32
14 ! CHECK-DAG: %[[VAL_19:.*]] = arith.constant 0 : i64
15 ! CHECK-DAG: %[[VAL_20:.*]] = arith.constant 1 : i64
16 ! CHECK-DAG: %[[VAL_21:.*]] = arith.constant 3 : i64
17 ! CHECK-DAG: %[[VAL_22:.*]] = arith.constant 4 : index
18 ! CHECK-DAG: %[[VAL_23:.*]] = arith.constant 1 : i32
19 ! CHECK-DAG: %[[VAL_24:.*]] = arith.constant 0 : i32
20 ! CHECK-DAG: %[[VAL_25:.*]] = fir.address_of(@_QFEa1) : !fir.ref<!fir.array<10x10xf32>>
21 ! CHECK-DAG: %[[VAL_26:.*]] = fir.alloca !fir.array<3xf32> {bindc_name = "a2", uniq_name = "_QFEa2"}
22 ! CHECK-DAG: %[[VAL_27:.*]] = fir.address_of(@_QFEa3) : !fir.ref<!fir.array<10xf32>>
23 ! CHECK-DAG: %[[VAL_28:.*]] = fir.alloca i32 {bindc_name = "i", uniq_name = "_QFEi"}
24 ! CHECK-DAG: %[[VAL_29:.*]] = fir.alloca !fir.array<3xi32> {bindc_name = "iv", uniq_name = "_QFEiv"}
25 ! CHECK-DAG: %[[VAL_30:.*]] = fir.alloca i32 {bindc_name = "j", uniq_name = "_QFEj"}
26 ! CHECK-DAG: %[[VAL_31:.*]] = fir.alloca i32 {bindc_name = "k", uniq_name = "_QFEk"}
27 ! CHECK: fir.store %[[VAL_24]] to %[[VAL_31]] : !fir.ref<i32>
28 ! CHECK: %[[STEP:.*]] = fir.convert %[[VAL_5]] : (index) -> i32
29 ! CHECK: br ^bb1(%[[STEP]], %[[VAL_0]] : i32, index)
30 ! CHECK: ^bb1(%[[VAL_32:.*]]: i32, %[[VAL_33:.*]]: index):
31 ! CHECK: %[[VAL_34:.*]] = arith.cmpi sgt, %[[VAL_33]], %[[VAL_6]] : index
32 ! CHECK: cond_br %[[VAL_34]], ^bb2, ^bb6
33 ! CHECK: ^bb2:
34 ! CHECK: fir.store %[[VAL_32]] to %[[VAL_30]] : !fir.ref<i32>
35 ! CHECK: br ^bb3(%[[STEP]], %[[VAL_0]] : i32, index)
36 ! CHECK: ^bb3(%[[VAL_36:.*]]: i32, %[[VAL_37:.*]]: index):
37 ! CHECK: %[[VAL_38:.*]] = arith.cmpi sgt, %[[VAL_37]], %[[VAL_6]] : index
38 ! CHECK: cond_br %[[VAL_38]], ^bb4, ^bb5
39 ! CHECK: ^bb4:
40 ! CHECK: fir.store %[[VAL_36]] to %[[VAL_28]] : !fir.ref<i32>
41 ! CHECK: %[[VAL_40:.*]] = fir.load %[[VAL_31]] : !fir.ref<i32>
42 ! CHECK: %[[VAL_41:.*]] = arith.addi %[[VAL_40]], %[[VAL_23]] : i32
43 ! CHECK: fir.store %[[VAL_41]] to %[[VAL_31]] : !fir.ref<i32>
44 ! CHECK: %[[VAL_42:.*]] = fir.load %[[VAL_31]] : !fir.ref<i32>
45 ! CHECK: %[[VAL_43:.*]] = fir.convert %[[VAL_42]] : (i32) -> f32
46 ! CHECK: %[[VAL_44:.*]] = fir.call @fir.cos.contract.f32.f32(%[[VAL_43]]) {{.*}}: (f32) -> f32
47 ! CHECK: %[[VAL_45:.*]] = fir.load %[[VAL_28]] : !fir.ref<i32>
48 ! CHECK: %[[VAL_46:.*]] = fir.convert %[[VAL_45]] : (i32) -> i64
49 ! CHECK: %[[VAL_47:.*]] = arith.subi %[[VAL_46]], %[[VAL_20]] : i64
50 ! CHECK: %[[VAL_48:.*]] = fir.load %[[VAL_30]] : !fir.ref<i32>
51 ! CHECK: %[[VAL_49:.*]] = fir.convert %[[VAL_48]] : (i32) -> i64
52 ! CHECK: %[[VAL_50:.*]] = arith.subi %[[VAL_49]], %[[VAL_20]] : i64
53 ! CHECK: %[[VAL_51:.*]] = fir.coordinate_of %[[VAL_25]], %[[VAL_47]], %[[VAL_50]] : (!fir.ref<!fir.array<10x10xf32>>, i64, i64) -> !fir.ref<f32>
54 ! CHECK: fir.store %[[VAL_44]] to %[[VAL_51]] : !fir.ref<f32>
55 ! CHECK: %[[LOADI:.*]] = fir.load %[[VAL_28]] : !fir.ref<i32>
56 ! CHECK: %[[VAL_52:.*]] = arith.addi %[[LOADI]], %[[STEP]] : i32
57 ! CHECK: %[[VAL_53:.*]] = arith.subi %[[VAL_37]], %[[VAL_5]] : index
58 ! CHECK: br ^bb3(%[[VAL_52]], %[[VAL_53]] : i32, index)
59 ! CHECK: ^bb5:
60 ! CHECK: fir.store %[[VAL_36]] to %[[VAL_28]] : !fir.ref<i32>
61 ! CHECK: %[[VAL_55:.*]] = fir.load %[[VAL_31]] : !fir.ref<i32>
62 ! CHECK: %[[VAL_56:.*]] = fir.convert %[[VAL_55]] : (i32) -> f32
63 ! CHECK: %[[VAL_57:.*]] = fir.call @fir.sin.contract.f32.f32(%[[VAL_56]]) {{.*}}: (f32) -> f32
64 ! CHECK: %[[VAL_58:.*]] = fir.load %[[VAL_30]] : !fir.ref<i32>
65 ! CHECK: %[[VAL_59:.*]] = fir.convert %[[VAL_58]] : (i32) -> i64
66 ! CHECK: %[[VAL_60:.*]] = arith.subi %[[VAL_59]], %[[VAL_20]] : i64
67 ! CHECK: %[[VAL_61:.*]] = fir.coordinate_of %[[VAL_27]], %[[VAL_60]] : (!fir.ref<!fir.array<10xf32>>, i64) -> !fir.ref<f32>
68 ! CHECK: fir.store %[[VAL_57]] to %[[VAL_61]] : !fir.ref<f32>
69 ! CHECK: %[[LOADJ:.*]] = fir.load %[[VAL_30]] : !fir.ref<i32>
70 ! CHECK: %[[VAL_62:.*]] = arith.addi %[[LOADJ]], %[[STEP]] : i32
71 ! CHECK: %[[VAL_63:.*]] = arith.subi %[[VAL_33]], %[[VAL_5]] : index
72 ! CHECK: br ^bb1(%[[VAL_62]], %[[VAL_63]] : i32, index)
73 ! CHECK: ^bb6:
74 ! CHECK: fir.store %[[VAL_32]] to %[[VAL_30]] : !fir.ref<i32>
75 ! CHECK: %[[VAL_65:.*]] = fir.shape %[[VAL_11]] : (index) -> !fir.shape<1>
76 ! CHECK: %[[VAL_66:.*]] = fir.undefined index
77 ! CHECK: %[[VAL_67:.*]] = fir.shape %[[VAL_0]], %[[VAL_0]] : (index, index) -> !fir.shape<2>
78 ! CHECK: %[[VAL_68:.*]] = fir.slice %[[VAL_16]], %[[VAL_66]], %[[VAL_66]], %[[VAL_4]], %[[VAL_0]], %[[VAL_11]] : (i64, index, index, index, index, index) -> !fir.slice<2>
79 ! CHECK: br ^bb7(%[[VAL_6]], %[[VAL_11]] : index, index)
80 ! CHECK: ^bb7(%[[VAL_69:.*]]: index, %[[VAL_70:.*]]: index):
81 ! CHECK: %[[VAL_71:.*]] = arith.cmpi sgt, %[[VAL_70]], %[[VAL_6]] : index
82 ! CHECK: cond_br %[[VAL_71]], ^bb8, ^bb9
83 ! CHECK: ^bb8:
84 ! CHECK: %[[VAL_72:.*]] = arith.addi %[[VAL_69]], %[[VAL_5]] : index
85 ! CHECK: %[[VAL_73:.*]] = fir.array_coor %[[VAL_25]](%[[VAL_67]]) {{\[}}%[[VAL_68]]] %[[VAL_22]], %[[VAL_72]] : (!fir.ref<!fir.array<10x10xf32>>, !fir.shape<2>, !fir.slice<2>, index, index) -> !fir.ref<f32>
86 ! CHECK: %[[VAL_74:.*]] = fir.load %[[VAL_73]] : !fir.ref<f32>
87 ! CHECK: %[[VAL_75:.*]] = fir.array_coor %[[VAL_26]](%[[VAL_65]]) %[[VAL_72]] : (!fir.ref<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
88 ! CHECK: fir.store %[[VAL_74]] to %[[VAL_75]] : !fir.ref<f32>
89 ! CHECK: %[[VAL_76:.*]] = arith.subi %[[VAL_70]], %[[VAL_5]] : index
90 ! CHECK: br ^bb7(%[[VAL_72]], %[[VAL_76]] : index, index)
91 ! CHECK: ^bb9:
92 ! CHECK: %[[VAL_77:.*]] = fir.coordinate_of %[[VAL_25]], %[[VAL_21]], %[[VAL_20]] : (!fir.ref<!fir.array<10x10xf32>>, i64, i64) -> !fir.ref<f32>
93 ! CHECK: %[[VAL_78:.*]] = fir.load %[[VAL_77]] : !fir.ref<f32>
94 ! CHECK: %[[VAL_79:.*]] = fir.coordinate_of %[[VAL_26]], %[[VAL_19]] : (!fir.ref<!fir.array<3xf32>>, i64) -> !fir.ref<f32>
95 ! CHECK: %[[VAL_80:.*]] = fir.load %[[VAL_79]] : !fir.ref<f32>
96 ! CHECK: %[[VAL_81:.*]] = arith.cmpf une, %[[VAL_78]], %[[VAL_80]] : f32
97 ! CHECK: cond_br %[[VAL_81]], ^bb10, ^bb11
98 ! CHECK: ^bb10:
99 ! CHECK: %[[VAL_82:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
100 ! CHECK: %[[VAL_83:.*]] = fir.convert %[[VAL_82]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
101 ! CHECK: %[[VAL_84:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_83]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
102 ! CHECK: %[[VAL_85:.*]] = fir.address_of(@_QQclX6D69736D617463682031) : !fir.ref<!fir.char<1,10>>
103 ! CHECK: %[[VAL_86:.*]] = fir.convert %[[VAL_85]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
104 ! CHECK: %[[VAL_87:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
105 ! CHECK: %[[VAL_88:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_84]], %[[VAL_86]], %[[VAL_87]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
106 ! CHECK: %[[VAL_89:.*]] = fir.load %[[VAL_79]] : !fir.ref<f32>
107 ! CHECK: %[[VAL_90:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_84]], %[[VAL_89]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
108 ! CHECK: %[[VAL_91:.*]] = fir.load %[[VAL_77]] : !fir.ref<f32>
109 ! CHECK: %[[VAL_92:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_84]], %[[VAL_91]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
110 ! CHECK: %[[VAL_93:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_84]]) {{.*}}: (!fir.ref<i8>) -> i32
111 ! CHECK: br ^bb11
112 ! CHECK: ^bb11:
113 ! CHECK: %[[VAL_94:.*]] = fir.coordinate_of %[[VAL_25]], %[[VAL_21]], %[[VAL_16]] : (!fir.ref<!fir.array<10x10xf32>>, i64, i64) -> !fir.ref<f32>
114 ! CHECK: %[[VAL_95:.*]] = fir.load %[[VAL_94]] : !fir.ref<f32>
115 ! CHECK: %[[VAL_96:.*]] = fir.coordinate_of %[[VAL_26]], %[[VAL_20]] : (!fir.ref<!fir.array<3xf32>>, i64) -> !fir.ref<f32>
116 ! CHECK: %[[VAL_97:.*]] = fir.load %[[VAL_96]] : !fir.ref<f32>
117 ! CHECK: %[[VAL_98:.*]] = arith.cmpf une, %[[VAL_95]], %[[VAL_97]] : f32
118 ! CHECK: cond_br %[[VAL_98]], ^bb12, ^bb13
119 ! CHECK: ^bb12:
120 ! CHECK: %[[VAL_99:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
121 ! CHECK: %[[VAL_100:.*]] = fir.convert %[[VAL_99]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
122 ! CHECK: %[[VAL_101:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_100]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
123 ! CHECK: %[[VAL_102:.*]] = fir.address_of(@_QQclX6D69736D617463682032) : !fir.ref<!fir.char<1,10>>
124 ! CHECK: %[[VAL_103:.*]] = fir.convert %[[VAL_102]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
125 ! CHECK: %[[VAL_104:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
126 ! CHECK: %[[VAL_105:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_101]], %[[VAL_103]], %[[VAL_104]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
127 ! CHECK: %[[VAL_106:.*]] = fir.load %[[VAL_96]] : !fir.ref<f32>
128 ! CHECK: %[[VAL_107:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_101]], %[[VAL_106]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
129 ! CHECK: %[[VAL_108:.*]] = fir.load %[[VAL_94]] : !fir.ref<f32>
130 ! CHECK: %[[VAL_109:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_101]], %[[VAL_108]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
131 ! CHECK: %[[VAL_110:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_101]]) {{.*}}: (!fir.ref<i8>) -> i32
132 ! CHECK: br ^bb13
133 ! CHECK: ^bb13:
134 ! CHECK: %[[VAL_111:.*]] = fir.coordinate_of %[[VAL_25]], %[[VAL_21]], %[[VAL_14]] : (!fir.ref<!fir.array<10x10xf32>>, i64, i64) -> !fir.ref<f32>
135 ! CHECK: %[[VAL_112:.*]] = fir.load %[[VAL_111]] : !fir.ref<f32>
136 ! CHECK: %[[VAL_113:.*]] = fir.coordinate_of %[[VAL_26]], %[[VAL_13]] : (!fir.ref<!fir.array<3xf32>>, i64) -> !fir.ref<f32>
137 ! CHECK: %[[VAL_114:.*]] = fir.load %[[VAL_113]] : !fir.ref<f32>
138 ! CHECK: %[[VAL_115:.*]] = arith.cmpf une, %[[VAL_112]], %[[VAL_114]] : f32
139 ! CHECK: cond_br %[[VAL_115]], ^bb14, ^bb15
140 ! CHECK: ^bb14:
141 ! CHECK: %[[VAL_116:.*]] = fir.address_of(@_QQclX{{.*}} : !fir.ref<!fir.char<1,
142 ! CHECK: %[[VAL_117:.*]] = fir.convert %[[VAL_116]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
143 ! CHECK: %[[VAL_118:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_117]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
144 ! CHECK: %[[VAL_119:.*]] = fir.address_of(@_QQclX6D69736D617463682033) : !fir.ref<!fir.char<1,10>>
145 ! CHECK: %[[VAL_120:.*]] = fir.convert %[[VAL_119]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
146 ! CHECK: %[[VAL_121:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
147 ! CHECK: %[[VAL_122:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_118]], %[[VAL_120]], %[[VAL_121]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
148 ! CHECK: %[[VAL_123:.*]] = fir.load %[[VAL_113]] : !fir.ref<f32>
149 ! CHECK: %[[VAL_124:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_118]], %[[VAL_123]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
150 ! CHECK: %[[VAL_125:.*]] = fir.load %[[VAL_111]] : !fir.ref<f32>
151 ! CHECK: %[[VAL_126:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_118]], %[[VAL_125]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
152 ! CHECK: %[[VAL_127:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_118]]) {{.*}}: (!fir.ref<i8>) -> i32
153 ! CHECK: br ^bb15
154 ! CHECK: ^bb15:
155 ! CHECK: %[[VAL_128:.*]] = fir.shape %[[VAL_0]] : (index) -> !fir.shape<1>
156 ! CHECK: %[[VAL_129:.*]] = fir.slice %[[VAL_5]], %[[VAL_0]], %[[VAL_22]] : (index, index, index) -> !fir.slice<1>
157 ! CHECK: br ^bb16(%[[VAL_6]], %[[VAL_11]] : index, index)
158 ! CHECK: ^bb16(%[[VAL_130:.*]]: index, %[[VAL_131:.*]]: index):
159 ! CHECK: %[[VAL_132:.*]] = arith.cmpi sgt, %[[VAL_131]], %[[VAL_6]] : index
160 ! CHECK: cond_br %[[VAL_132]], ^bb17, ^bb18
161 ! CHECK: ^bb17:
162 ! CHECK: %[[VAL_133:.*]] = arith.addi %[[VAL_130]], %[[VAL_5]] : index
163 ! CHECK: %[[VAL_134:.*]] = fir.array_coor %[[VAL_26]](%[[VAL_65]]) %[[VAL_133]] : (!fir.ref<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
164 ! CHECK: %[[VAL_135:.*]] = fir.load %[[VAL_134]] : !fir.ref<f32>
165 ! CHECK: %[[VAL_136:.*]] = fir.array_coor %[[VAL_27]](%[[VAL_128]]) {{\[}}%[[VAL_129]]] %[[VAL_133]] : (!fir.ref<!fir.array<10xf32>>, !fir.shape<1>, !fir.slice<1>, index) -> !fir.ref<f32>
166 ! CHECK: fir.store %[[VAL_135]] to %[[VAL_136]] : !fir.ref<f32>
167 ! CHECK: %[[VAL_137:.*]] = arith.subi %[[VAL_131]], %[[VAL_5]] : index
168 ! CHECK: br ^bb16(%[[VAL_133]], %[[VAL_137]] : index, index)
169 ! CHECK: ^bb18:
170 ! CHECK: %[[VAL_138:.*]] = fir.load %[[VAL_77]] : !fir.ref<f32>
171 ! CHECK: %[[VAL_139:.*]] = fir.coordinate_of %[[VAL_27]], %[[VAL_19]] : (!fir.ref<!fir.array<10xf32>>, i64) -> !fir.ref<f32>
172 ! CHECK: %[[VAL_140:.*]] = fir.load %[[VAL_139]] : !fir.ref<f32>
173 ! CHECK: %[[VAL_141:.*]] = arith.cmpf une, %[[VAL_138]], %[[VAL_140]] : f32
174 ! CHECK: cond_br %[[VAL_141]], ^bb19, ^bb20
175 ! CHECK: ^bb19:
176 ! CHECK: %[[VAL_142:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
177 ! CHECK: %[[VAL_143:.*]] = fir.convert %[[VAL_142]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
178 ! CHECK: %[[VAL_144:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_143]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
179 ! CHECK: %[[VAL_145:.*]] = fir.address_of(@_QQclX6D69736D617463682034) : !fir.ref<!fir.char<1,10>>
180 ! CHECK: %[[VAL_146:.*]] = fir.convert %[[VAL_145]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
181 ! CHECK: %[[VAL_147:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
182 ! CHECK: %[[VAL_148:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_144]], %[[VAL_146]], %[[VAL_147]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
183 ! CHECK: %[[VAL_149:.*]] = fir.load %[[VAL_77]] : !fir.ref<f32>
184 ! CHECK: %[[VAL_150:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_144]], %[[VAL_149]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
185 ! CHECK: %[[VAL_151:.*]] = fir.load %[[VAL_139]] : !fir.ref<f32>
186 ! CHECK: %[[VAL_152:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_144]], %[[VAL_151]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
187 ! CHECK: %[[VAL_153:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_144]]) {{.*}}: (!fir.ref<i8>) -> i32
188 ! CHECK: br ^bb20
189 ! CHECK: ^bb20:
190 ! CHECK: %[[VAL_154:.*]] = fir.load %[[VAL_94]] : !fir.ref<f32>
191 ! CHECK: %[[VAL_155:.*]] = fir.coordinate_of %[[VAL_27]], %[[VAL_16]] : (!fir.ref<!fir.array<10xf32>>, i64) -> !fir.ref<f32>
192 ! CHECK: %[[VAL_156:.*]] = fir.load %[[VAL_155]] : !fir.ref<f32>
193 ! CHECK: %[[VAL_157:.*]] = arith.cmpf une, %[[VAL_154]], %[[VAL_156]] : f32
194 ! CHECK: cond_br %[[VAL_157]], ^bb21, ^bb22
195 ! CHECK: ^bb21:
196 ! CHECK: %[[VAL_158:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
197 ! CHECK: %[[VAL_159:.*]] = fir.convert %[[VAL_158]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
198 ! CHECK: %[[VAL_160:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_159]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
199 ! CHECK: %[[VAL_161:.*]] = fir.address_of(@_QQclX6D69736D617463682035) : !fir.ref<!fir.char<1,10>>
200 ! CHECK: %[[VAL_162:.*]] = fir.convert %[[VAL_161]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
201 ! CHECK: %[[VAL_163:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
202 ! CHECK: %[[VAL_164:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_160]], %[[VAL_162]], %[[VAL_163]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
203 ! CHECK: %[[VAL_165:.*]] = fir.load %[[VAL_94]] : !fir.ref<f32>
204 ! CHECK: %[[VAL_166:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_160]], %[[VAL_165]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
205 ! CHECK: %[[VAL_167:.*]] = fir.load %[[VAL_155]] : !fir.ref<f32>
206 ! CHECK: %[[VAL_168:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_160]], %[[VAL_167]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
207 ! CHECK: %[[VAL_169:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_160]]) {{.*}}: (!fir.ref<i8>) -> i32
208 ! CHECK: br ^bb22
209 ! CHECK: ^bb22:
210 ! CHECK: %[[VAL_170:.*]] = fir.load %[[VAL_111]] : !fir.ref<f32>
211 ! CHECK: %[[VAL_171:.*]] = fir.coordinate_of %[[VAL_27]], %[[VAL_8]] : (!fir.ref<!fir.array<10xf32>>, i64) -> !fir.ref<f32>
212 ! CHECK: %[[VAL_172:.*]] = fir.load %[[VAL_171]] : !fir.ref<f32>
213 ! CHECK: %[[VAL_173:.*]] = arith.cmpf une, %[[VAL_170]], %[[VAL_172]] : f32
214 ! CHECK: cond_br %[[VAL_173]], ^bb23, ^bb24
215 ! CHECK: ^bb23:
216 ! CHECK: %[[VAL_174:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
217 ! CHECK: %[[VAL_175:.*]] = fir.convert %[[VAL_174]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
218 ! CHECK: %[[VAL_176:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_175]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
219 ! CHECK: %[[VAL_177:.*]] = fir.address_of(@_QQclX6D69736D617463682036) : !fir.ref<!fir.char<1,10>>
220 ! CHECK: %[[VAL_178:.*]] = fir.convert %[[VAL_177]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
221 ! CHECK: %[[VAL_179:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
222 ! CHECK: %[[VAL_180:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_176]], %[[VAL_178]], %[[VAL_179]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
223 ! CHECK: %[[VAL_181:.*]] = fir.load %[[VAL_111]] : !fir.ref<f32>
224 ! CHECK: %[[VAL_182:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_176]], %[[VAL_181]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
225 ! CHECK: %[[VAL_183:.*]] = fir.load %[[VAL_171]] : !fir.ref<f32>
226 ! CHECK: %[[VAL_184:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_176]], %[[VAL_183]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
227 ! CHECK: %[[VAL_185:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_176]]) {{.*}}: (!fir.ref<i8>) -> i32
228 ! CHECK: br ^bb24
229 ! CHECK: ^bb24:
230 ! CHECK: %[[VAL_186:.*]] = fir.address_of(@_QQro.3xi4.0) : !fir.ref<!fir.array<3xi32>>
231 ! CHECK: br ^bb25(%[[VAL_6]], %[[VAL_11]] : index, index)
232 ! CHECK: ^bb25(%[[VAL_187:.*]]: index, %[[VAL_188:.*]]: index):
233 ! CHECK: %[[VAL_189:.*]] = arith.cmpi sgt, %[[VAL_188]], %[[VAL_6]] : index
234 ! CHECK: cond_br %[[VAL_189]], ^bb26, ^bb27
235 ! CHECK: ^bb26:
236 ! CHECK: %[[VAL_190:.*]] = arith.addi %[[VAL_187]], %[[VAL_5]] : index
237 ! CHECK: %[[VAL_191:.*]] = fir.array_coor %[[VAL_186]](%[[VAL_65]]) %[[VAL_190]] : (!fir.ref<!fir.array<3xi32>>, !fir.shape<1>, index) -> !fir.ref<i32>
238 ! CHECK: %[[VAL_192:.*]] = fir.load %[[VAL_191]] : !fir.ref<i32>
239 ! CHECK: %[[VAL_193:.*]] = fir.array_coor %[[VAL_29]](%[[VAL_65]]) %[[VAL_190]] : (!fir.ref<!fir.array<3xi32>>, !fir.shape<1>, index) -> !fir.ref<i32>
240 ! CHECK: fir.store %[[VAL_192]] to %[[VAL_193]] : !fir.ref<i32>
241 ! CHECK: %[[VAL_194:.*]] = arith.subi %[[VAL_188]], %[[VAL_5]] : index
242 ! CHECK: br ^bb25(%[[VAL_190]], %[[VAL_194]] : index, index)
243 ! CHECK: ^bb27:
244 ! CHECK: %[[VAL_195:.*]] = fir.allocmem !fir.array<3xf32>
245 ! CHECK: br ^bb28(%[[VAL_6]], %[[VAL_11]] : index, index)
246 ! CHECK: ^bb28(%[[VAL_196:.*]]: index, %[[VAL_197:.*]]: index):
247 ! CHECK: %[[VAL_198:.*]] = arith.cmpi sgt, %[[VAL_197]], %[[VAL_6]] : index
248 ! CHECK: cond_br %[[VAL_198]], ^bb29, ^bb30
249 ! CHECK: ^bb29:
250 ! CHECK: %[[VAL_199:.*]] = arith.addi %[[VAL_196]], %[[VAL_5]] : index
251 ! CHECK: %[[VAL_200:.*]] = fir.array_coor %[[VAL_26]](%[[VAL_65]]) %[[VAL_199]] : (!fir.ref<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
252 ! CHECK: %[[VAL_201:.*]] = fir.array_coor %[[VAL_195]](%[[VAL_65]]) %[[VAL_199]] : (!fir.heap<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
253 ! CHECK: %[[VAL_202:.*]] = fir.load %[[VAL_200]] : !fir.ref<f32>
254 ! CHECK: fir.store %[[VAL_202]] to %[[VAL_201]] : !fir.ref<f32>
255 ! CHECK: %[[VAL_203:.*]] = arith.subi %[[VAL_197]], %[[VAL_5]] : index
256 ! CHECK: br ^bb28(%[[VAL_199]], %[[VAL_203]] : index, index)
257 ! CHECK: ^bb30(%[[VAL_205:.*]]: index, %[[VAL_206:.*]]: index):
258 ! CHECK: %[[VAL_207:.*]] = arith.cmpi sgt, %[[VAL_206]], %[[VAL_6]] : index
259 ! CHECK: cond_br %[[VAL_207]], ^bb31, ^bb32(%[[VAL_6]], %[[VAL_11]] : index, index)
260 ! CHECK: ^bb31:
261 ! CHECK: %[[VAL_208:.*]] = arith.addi %[[VAL_205]], %[[VAL_5]] : index
262 ! CHECK: %[[VAL_209:.*]] = fir.array_coor %[[VAL_29]](%[[VAL_65]]) %[[VAL_208]] : (!fir.ref<!fir.array<3xi32>>, !fir.shape<1>, index) -> !fir.ref<i32>
263 ! CHECK: %[[VAL_210:.*]] = fir.load %[[VAL_209]] : !fir.ref<i32>
264 ! CHECK: %[[VAL_211:.*]] = fir.convert %[[VAL_210]] : (i32) -> index
265 ! CHECK: %[[VAL_212:.*]] = fir.array_coor %[[VAL_26]](%[[VAL_65]]) %[[VAL_211]] : (!fir.ref<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
266 ! CHECK: %[[VAL_213:.*]] = fir.load %[[VAL_212]] : !fir.ref<f32>
267 ! CHECK: %[[VAL_214:.*]] = fir.array_coor %[[VAL_195]](%[[VAL_65]]) %[[VAL_208]] : (!fir.heap<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
268 ! CHECK: fir.store %[[VAL_213]] to %[[VAL_214]] : !fir.ref<f32>
269 ! CHECK: %[[VAL_215:.*]] = arith.subi %[[VAL_206]], %[[VAL_5]] : index
270 ! CHECK: br ^bb30(%[[VAL_208]], %[[VAL_215]] : index, index)
271 ! CHECK: ^bb32(%[[VAL_216:.*]]: index, %[[VAL_217:.*]]: index):
272 ! CHECK: %[[VAL_218:.*]] = arith.cmpi sgt, %[[VAL_217]], %[[VAL_6]] : index
273 ! CHECK: cond_br %[[VAL_218]], ^bb33, ^bb34
274 ! CHECK: ^bb33:
275 ! CHECK: %[[VAL_219:.*]] = arith.addi %[[VAL_216]], %[[VAL_5]] : index
276 ! CHECK: %[[VAL_220:.*]] = fir.array_coor %[[VAL_195]](%[[VAL_65]]) %[[VAL_219]] : (!fir.heap<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
277 ! CHECK: %[[VAL_221:.*]] = fir.array_coor %[[VAL_26]](%[[VAL_65]]) %[[VAL_219]] : (!fir.ref<!fir.array<3xf32>>, !fir.shape<1>, index) -> !fir.ref<f32>
278 ! CHECK: %[[VAL_222:.*]] = fir.load %[[VAL_220]] : !fir.ref<f32>
279 ! CHECK: fir.store %[[VAL_222]] to %[[VAL_221]] : !fir.ref<f32>
280 ! CHECK: %[[VAL_223:.*]] = arith.subi %[[VAL_217]], %[[VAL_5]] : index
281 ! CHECK: br ^bb32(%[[VAL_219]], %[[VAL_223]] : index, index)
282 ! CHECK: ^bb34:
283 ! CHECK: fir.freemem %[[VAL_195]] : !fir.heap<!fir.array<3xf32>>
284 ! CHECK: %[[VAL_224:.*]] = fir.load %[[VAL_77]] : !fir.ref<f32>
285 ! CHECK: %[[VAL_225:.*]] = fir.load %[[VAL_96]] : !fir.ref<f32>
286 ! CHECK: %[[VAL_226:.*]] = arith.cmpf une, %[[VAL_224]], %[[VAL_225]] : f32
287 ! CHECK: cond_br %[[VAL_226]], ^bb35, ^bb36
288 ! CHECK: ^bb35:
289 ! CHECK: %[[VAL_227:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
290 ! CHECK: %[[VAL_228:.*]] = fir.convert %[[VAL_227]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
291 ! CHECK: %[[VAL_229:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_228]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
292 ! CHECK: %[[VAL_230:.*]] = fir.address_of(@_QQclX6D69736D617463682037) : !fir.ref<!fir.char<1,10>>
293 ! CHECK: %[[VAL_231:.*]] = fir.convert %[[VAL_230]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
294 ! CHECK: %[[VAL_232:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
295 ! CHECK: %[[VAL_233:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_229]], %[[VAL_231]], %[[VAL_232]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
296 ! CHECK: %[[VAL_234:.*]] = fir.load %[[VAL_77]] : !fir.ref<f32>
297 ! CHECK: %[[VAL_235:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_229]], %[[VAL_234]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
298 ! CHECK: %[[VAL_236:.*]] = fir.load %[[VAL_96]] : !fir.ref<f32>
299 ! CHECK: %[[VAL_237:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_229]], %[[VAL_236]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
300 ! CHECK: %[[VAL_238:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_229]]) {{.*}}: (!fir.ref<i8>) -> i32
301 ! CHECK: br ^bb36
302 ! CHECK: ^bb36:
303 ! CHECK: %[[VAL_239:.*]] = fir.load %[[VAL_94]] : !fir.ref<f32>
304 ! CHECK: %[[VAL_240:.*]] = fir.load %[[VAL_113]] : !fir.ref<f32>
305 ! CHECK: %[[VAL_241:.*]] = arith.cmpf une, %[[VAL_239]], %[[VAL_240]] : f32
306 ! CHECK: cond_br %[[VAL_241]], ^bb37, ^bb38
307 ! CHECK: ^bb37:
308 ! CHECK: %[[VAL_242:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
309 ! CHECK: %[[VAL_243:.*]] = fir.convert %[[VAL_242]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
310 ! CHECK: %[[VAL_244:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_243]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
311 ! CHECK: %[[VAL_245:.*]] = fir.address_of(@_QQclX6D69736D617463682038) : !fir.ref<!fir.char<1,10>>
312 ! CHECK: %[[VAL_246:.*]] = fir.convert %[[VAL_245]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
313 ! CHECK: %[[VAL_247:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
314 ! CHECK: %[[VAL_248:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_244]], %[[VAL_246]], %[[VAL_247]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
315 ! CHECK: %[[VAL_249:.*]] = fir.load %[[VAL_94]] : !fir.ref<f32>
316 ! CHECK: %[[VAL_250:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_244]], %[[VAL_249]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
317 ! CHECK: %[[VAL_251:.*]] = fir.load %[[VAL_113]] : !fir.ref<f32>
318 ! CHECK: %[[VAL_252:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_244]], %[[VAL_251]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
319 ! CHECK: %[[VAL_253:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_244]]) {{.*}}: (!fir.ref<i8>) -> i32
320 ! CHECK: br ^bb38
321 ! CHECK: ^bb38:
322 ! CHECK: %[[VAL_254:.*]] = fir.load %[[VAL_111]] : !fir.ref<f32>
323 ! CHECK: %[[VAL_255:.*]] = fir.load %[[VAL_79]] : !fir.ref<f32>
324 ! CHECK: %[[VAL_256:.*]] = arith.cmpf une, %[[VAL_254]], %[[VAL_255]] : f32
325 ! CHECK: cond_br %[[VAL_256]], ^bb39, ^bb40
326 ! CHECK: ^bb39:
327 ! CHECK: %[[VAL_257:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
328 ! CHECK: %[[VAL_258:.*]] = fir.convert %[[VAL_257]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
329 ! CHECK: %[[VAL_259:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_18]], %[[VAL_258]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
330 ! CHECK: %[[VAL_260:.*]] = fir.address_of(@_QQclX6D69736D617463682039) : !fir.ref<!fir.char<1,10>>
331 ! CHECK: %[[VAL_261:.*]] = fir.convert %[[VAL_260]] : (!fir.ref<!fir.char<1,10>>) -> !fir.ref<i8>
332 ! CHECK: %[[VAL_262:.*]] = fir.convert %[[VAL_0]] : (index) -> i64
333 ! CHECK: %[[VAL_263:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_259]], %[[VAL_261]], %[[VAL_262]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
334 ! CHECK: %[[VAL_264:.*]] = fir.load %[[VAL_111]] : !fir.ref<f32>
335 ! CHECK: %[[VAL_265:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_259]], %[[VAL_264]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
336 ! CHECK: %[[VAL_266:.*]] = fir.load %[[VAL_79]] : !fir.ref<f32>
337 ! CHECK: %[[VAL_267:.*]] = fir.call @_FortranAioOutputReal32(%[[VAL_259]], %[[VAL_266]]) {{.*}}: (!fir.ref<i8>, f32) -> i1
338 ! CHECK: %[[VAL_268:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_259]]) {{.*}}: (!fir.ref<i8>) -> i32
339 ! CHECK: br ^bb40
340 ! CHECK: ^bb40:
341 ! CHECK: return
342 ! CHECK: }
344 program p
345 real :: a1(10,10)
346 real :: a2(3)
347 real :: a3(10)
348 integer iv(3)
349 integer k
351 k = 0
352 do j = 1, 10
353 do i = 1, 10
354 k = k + 1
355 a1(i,j) = cos(real(k))
356 end do
357 a3(j) = sin(real(k))
358 end do
360 a2 = a1(4, 2:10:3)
362 if (a1(4,2) .ne. a2(1)) print *, "mismatch 1", a2(1), a1(4,2)
363 if (a1(4,5) .ne. a2(2)) print *, "mismatch 2", a2(2), a1(4,5)
364 if (a1(4,8) .ne. a2(3)) print *, "mismatch 3", a2(3), a1(4,8)
366 a3(1:10:4) = a2
368 if (a1(4,2) .ne. a3(1)) print *, "mismatch 4", a1(4,2), a3(1)
369 if (a1(4,5) .ne. a3(5)) print *, "mismatch 5", a1(4,5), a3(5)
370 if (a1(4,8) .ne. a3(9)) print *, "mismatch 6", a1(4,8), a3(9)
372 iv = (/ 3, 1, 2 /)
374 a2 = a2(iv)
376 if (a1(4,2) .ne. a2(2)) print *, "mismatch 7", a1(4,2), a2(2)
377 if (a1(4,5) .ne. a2(3)) print *, "mismatch 8", a1(4,5), a2(3)
378 if (a1(4,8) .ne. a2(1)) print *, "mismatch 9", a1(4,8), a2(1)
380 end program p
382 ! CHECK-LABEL: func @_QPsub(
383 ! CHECK-SAME: %[[VAL_0:.*]]: !fir.boxchar<1>{{.*}}) {
384 ! CHECK-DAG: %[[VAL_1:.*]] = arith.constant 5 : index
385 ! CHECK-DAG: %[[VAL_2:.*]] = arith.constant 2 : index
386 ! CHECK-DAG: %[[VAL_3:.*]] = arith.constant 1 : index
387 ! CHECK-DAG: %[[VAL_4:.*]] = arith.constant 4 : index
388 ! CHECK-DAG: %[[VAL_6:.*]] = arith.constant -1 : i32
389 ! CHECK-DAG: %[[VAL_7:.*]] = arith.constant 10 : index
390 ! CHECK: %[[VAL_8:.*]]:2 = fir.unboxchar %[[VAL_0]] : (!fir.boxchar<1>) -> (!fir.ref<!fir.char<1,?>>, index)
391 ! CHECK: %[[VAL_9:.*]] = fir.convert %[[VAL_8]]#0 : (!fir.ref<!fir.char<1,?>>) -> !fir.ref<!fir.array<10x!fir.char<1>>>
392 ! CHECK: %[[VAL_10:.*]] = fir.address_of(@_QQclX{{.*}}) : !fir.ref<!fir.char<1,
393 ! CHECK: %[[VAL_11:.*]] = fir.convert %[[VAL_10]] : (!fir.ref<!fir.char<1,{{.*}}>>) -> !fir.ref<i8>
394 ! CHECK: %[[VAL_12:.*]] = fir.call @_FortranAioBeginExternalListOutput(%[[VAL_6]], %[[VAL_11]], %{{.*}}) {{.*}}: (i32, !fir.ref<i8>, i32) -> !fir.ref<i8>
395 ! CHECK: %[[VAL_13:.*]] = fir.address_of(@_QQclX61203D20) : !fir.ref<!fir.char<1,4>>
396 ! CHECK: %[[VAL_14:.*]] = fir.convert %[[VAL_13]] : (!fir.ref<!fir.char<1,4>>) -> !fir.ref<i8>
397 ! CHECK: %[[VAL_15:.*]] = fir.convert %[[VAL_4]] : (index) -> i64
398 ! CHECK: %[[VAL_16:.*]] = fir.call @_FortranAioOutputAscii(%[[VAL_12]], %[[VAL_14]], %[[VAL_15]]) {{.*}}: (!fir.ref<i8>, !fir.ref<i8>, i64) -> i1
399 ! CHECK: %[[VAL_17:.*]] = fir.shape %[[VAL_7]] : (index) -> !fir.shape<1>
400 ! CHECK: %[[VAL_18:.*]] = fir.slice %[[VAL_3]], %[[VAL_1]], %[[VAL_2]] : (index, index, index) -> !fir.slice<1>
401 ! CHECK: %[[VAL_19:.*]] = fir.embox %[[VAL_9]](%[[VAL_17]]) {{\[}}%[[VAL_18]]] : (!fir.ref<!fir.array<10x!fir.char<1>>>, !fir.shape<1>, !fir.slice<1>) -> !fir.box<!fir.array<3x!fir.char<1>>>
402 ! CHECK: %[[VAL_20:.*]] = fir.convert %[[VAL_19]] : (!fir.box<!fir.array<3x!fir.char<1>>>) -> !fir.box<none>
403 ! CHECK: %[[VAL_21:.*]] = fir.call @_FortranAioOutputDescriptor(%[[VAL_12]], %[[VAL_20]]) {{.*}}: (!fir.ref<i8>, !fir.box<none>) -> i1
404 ! CHECK: %[[VAL_22:.*]] = fir.call @_FortranAioEndIoStatement(%[[VAL_12]]) {{.*}}: (!fir.ref<i8>) -> i32
405 ! CHECK: return
406 ! CHECK: }
408 ! Slice operation on array of CHARACTER
409 subroutine sub(a)
410 character :: a(10)
411 print *, "a = ", a(1:5:2)
412 end subroutine sub