Skip to content

Commit 930bcf5

Browse files
committed
Fix tests
1 parent 917ae2d commit 930bcf5

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

test/IRGen/large_argument_result_c.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
// REQUIRES: PTRSIZE=64
44

5+
// Whether llvm can remove the first two memcmp's dependents on the ABI (arm64's
6+
// PCS, says stack arguments might be written to; x86-64 ABI copies indirect
7+
// parameters for the call)
8+
// REQUIRES: CPU=arm64 || CPU=arm64e
9+
510
// CHECK: define swiftcc void @"$s23large_argument_result_c7runTestyySo0A6_thingaF"(ptr {{.*}} %0)
611
// CHECK: [[CALL_ALLOCA:%.*]] = alloca <{ %Ts6UInt64V, %Ts6UInt64V, %Ts6UInt64V
712
// CHECK: [[TMP_ALLOCA:%.*]] = alloca %TSo11large_thinga, align 8
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %target-swift-frontend %S/large_argument_result_c.swift -Osize -import-objc-header %S/Inputs/large_argument_result_c.h -emit-ir -o - 2>&1 | %FileCheck %s
2+
3+
// REQUIRES: PTRSIZE=64
4+
5+
// Whether llvm can remove the first two memcmp's dependents on the ABI (arm64's
6+
// PCS, says stack arguments might be written to; x86-64 ABI copies indirect
7+
// parameters for the call)
8+
// REQUIRES: CPU=x86_64
9+
10+
// CHECK: define {{.*}}swiftcc void @"$s23large_argument_result_c7runTestyySo0A6_thingaF"(ptr {{.*}} %0)
11+
// CHECK: [[CALL_ALLOCA:%.*]] = alloca <{ %Ts6UInt64V, %Ts6UInt64V, %Ts6UInt64V
12+
// CHECK: call void @pass_and_return(ptr {{.*}} [[CALL_ALLOCA]], ptr nonnull byval{{.*}} %0, ptr nonnull byval{{.*}} %0)
13+
// CHECK: call {{.*}} @swift_allocObject
14+
// CHECK: [[BOX:%.*]] = {{.*}}call noalias ptr @swift_allocObject(
15+
// CHECK: [[ADDR_IN_BOX:%.*]] = getelementptr inbounds <{ %swift.refcounted, [128 x i8] }>, ptr [[BOX]], i64 0, i32 1
16+
// CHECK: call void @llvm.memcpy.p0.p0.i64(ptr {{.*}} [[ADDR_IN_BOX]], ptr {{.*}} [[CALL_ALLOCA]], i64 128, i1 false)
17+
// CHECK: call void @llvm.lifetime.end.p0(i64 128, ptr nonnull [[CALL_ALLOCA]])
18+
public func runTest(_ l : large_thing) {
19+
let r = pass_and_return(l, l)
20+
print(r)
21+
}

0 commit comments

Comments
 (0)