@@ -206,6 +206,31 @@ GT_128 call_and_get_gt_128() {
206
206
// LLVM: call void @llvm.memcpy.p0.p0.i64(ptr %[[#V1]], ptr %[[#V2]], i64 12, i1 false)
207
207
void passS (S s ) {}
208
208
209
+ // CHECK: @callS()
210
+ // CHECK: %[[#V0:]] = cir.alloca !ty_S, !cir.ptr<!ty_S>, ["s"] {alignment = 4 : i64}
211
+ // CHECK: %[[#V1:]] = cir.alloca !cir.array<!u64i x 2>, !cir.ptr<!cir.array<!u64i x 2>>, ["tmp"] {alignment = 8 : i64}
212
+ // CHECK: %[[#V2:]] = cir.load %[[#V0]] : !cir.ptr<!ty_S>, !ty_S
213
+ // CHECK: %[[#V3:]] = cir.cast(bitcast, %[[#V0]] : !cir.ptr<!ty_S>), !cir.ptr<!void>
214
+ // CHECK: %[[#V4:]] = cir.cast(bitcast, %[[#V1]] : !cir.ptr<!cir.array<!u64i x 2>>), !cir.ptr<!void>
215
+ // CHECK: %[[#V5:]] = cir.const #cir.int<12> : !u64i
216
+ // CHECK: cir.libc.memcpy %[[#V5]] bytes from %[[#V3]] to %[[#V4]] : !u64i, !cir.ptr<!void> -> !cir.ptr<!void>
217
+ // CHECK: %[[#V6:]] = cir.load %[[#V1]] : !cir.ptr<!cir.array<!u64i x 2>>, !cir.array<!u64i x 2>
218
+ // CHECK: cir.call @passS(%[[#V6]]) : (!cir.array<!u64i x 2>) -> ()
219
+ // CHECK: cir.return
220
+
221
+ // LLVM: @callS()
222
+ // LLVM: %[[#V1:]] = alloca %struct.S, i64 1, align 4
223
+ // LLVM: %[[#V2:]] = alloca [2 x i64], i64 1, align 8
224
+ // LLVM: %[[#V3:]] = load %struct.S, ptr %[[#V1]], align 4
225
+ // LLVM: call void @llvm.memcpy.p0.p0.i64(ptr %[[#V2]], ptr %[[#V1]], i64 12, i1 false)
226
+ // LLVM: %[[#V4:]] = load [2 x i64], ptr %[[#V2]], align 8
227
+ // LLVM: call void @passS([2 x i64] %[[#V4]])
228
+ // LLVM: ret void
229
+ void callS () {
230
+ S s ;
231
+ passS (s );
232
+ }
233
+
209
234
typedef struct {
210
235
uint8_t a ;
211
236
uint16_t b ;
0 commit comments