Skip to content

[DNM] [rebranch] Adjust some tests to pass again #81190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: rebranch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions test/AutoDiff/IRGen/differentiable_function.sil
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ bb0:
return %result : $@differentiable(reverse) @callee_guaranteed (Float) -> Float
}

// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>)
// CHECK-LABEL: define{{.*}}test_form_diff_func(ptr noalias sret(<{ %swift.function, %swift.function, %swift.function }>) captures(none)
// CHECK-SAME: [[OUT:%.*]])
// CHECK: [[OUT_ORIG:%.*]] = getelementptr{{.*}}[[OUT]], i32 0, i32 0
// CHECK: [[OUT_ORIG_FN:%.*]] = getelementptr{{.*}}[[OUT_ORIG]], i32 0, i32 0
Expand All @@ -60,7 +60,7 @@ bb0(%0 : $@differentiable(reverse) @callee_guaranteed (Float) -> Float):
return %result : $(@callee_guaranteed (Float) -> Float, @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float), @callee_guaranteed (Float) -> (Float, @owned @callee_guaranteed (Float) -> Float))
}

// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias captures(none) sret(<{ %swift.function, %swift.function, %swift.function }>)
// CHECK-LABEL: define{{.*}}@test_extract_components(ptr noalias sret(<{ %swift.function, %swift.function, %swift.function }>) captures(none)
// CHECK-SAME: [[OUT:%.*]], ptr{{.*}}[[IN:%.*]])
// CHECK: [[ORIG:%.*]] = getelementptr{{.*}}[[IN]], i32 0, i32 0
// CHECK: [[ORIG_FN_ADDR:%.*]] = getelementptr{{.*}}[[ORIG]], i32 0, i32 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public distributed actor MyOtherActor {
// CHECK: missing-witness1:
// CHECK-NEXT: call void @llvm.trap()
// CHECK-NEXT: unreachable
// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias captures(none) sret(%swift.opaque) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias captures(none) dereferenceable(4) %swifterror)
// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(%swift.opaque* noalias sret(%swift.opaque) captures(none) [[ARG_0_RES_SLOT]], %swift.type* %arg_type, i8** [[ENCODABLE_WITNESS]], i8** [[DECODABLE_WITNESS]], %T27FakeDistributedActorSystems0A17InvocationDecoderC* swiftself [[DECODER]], %swift.error** noalias captures(none) dereferenceable(4) %swifterror)

// CHECK: store %swift.error* null, %swift.error** %swifterror
// CHECK-NEXT: [[ARG_0_VAL_ADDR:%.*]] = bitcast i8* [[ARG_0_VALUE_BUF]] to %TSi*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public distributed actor MyOtherActor {
// CHECK: missing-witness1:
// CHECK-NEXT: call void @llvm.trap()
// CHECK-NEXT: unreachable
// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias captures(none) swifterror dereferenceable(8) %swifterror)
// CHECK: call swiftcc void @"$s27FakeDistributedActorSystems0A17InvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"(ptr noalias sret(%swift.opaque) [[ARG_0_VALUE_BUF]], ptr %arg_type, ptr [[ENCODABLE_WITNESS]], ptr [[DECODABLE_WITNESS]], ptr swiftself [[DECODER]], ptr noalias swifterror captures(none) dereferenceable(8) %swifterror)

// CHECK: store ptr null, ptr %swifterror
// CHECK-NEXT: %._value = getelementptr inbounds{{.*}} %TSi, ptr [[ARG_0_VALUE_BUF]], i32 0, i32 0
Expand Down
4 changes: 2 additions & 2 deletions test/IRGen/abi_v7k.swift
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func testRet3() -> MyRect2 {
}

// Returning tuple?: (Int x 6)?
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2)
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax2{{.*}}"(ptr noalias sret({{.*}}) captures(none) %0, i32 %1, i32 %2)
// V7K-LABEL: _$s8test_v7k7minMax2
// We will indirectly return an optional with the address in r0, input parameters will be in r1 and r2
// V7K: str r0, [sp, [[IDX:#[0-9]+]]]
Expand Down Expand Up @@ -324,7 +324,7 @@ func minMax2(x : Int, y : Int) -> (min: Int, max: Int, min2: Int, max2: Int, min
}

// Returning struct?: {Int x 6}?
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias captures(none) sret({{.*}}) %0, i32 %1, i32 %2)
// CHECK-LABEL: define hidden swiftcc void @"$s8test_v7k7minMax3{{.*}}"(ptr noalias sret({{.*}}) captures(none) %0, i32 %1, i32 %2)
// V7K-LABEL: _$s8test_v7k7minMax3
struct Ret {
var min:Int
Expand Down
32 changes: 16 additions & 16 deletions test/IRGen/abitypes_objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ class Foo {
// x86_64-macosx: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} {
// x86_64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// x86_64-ios: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} {
// i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} {
// i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// i386-ios: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) captures(none) %0, ptr swiftself %1) {{.*}} {
// i386-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// armv7-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// armv7-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// armv7s-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// armv7s-ios: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// arm64-ios: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// arm64-ios: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} {
// x86_64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// x86_64-tvos: define internal { <2 x float>, <2 x float> } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} {
// arm64-tvos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// arm64-tvos: define internal [[ARM64_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} {
// i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias captures(none) sret({{.*}}) %0, ptr swiftself %1) {{.*}} {
// i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// i386-watchos: define hidden swiftcc void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr noalias sret({{.*}}) captures(none) %0, ptr swiftself %1) {{.*}} {
// i386-watchos: define internal void @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// armv7k-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// armv7k-watchos: define internal [[ARMV7K_MYRECT]] @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}FTo"(ptr %0, ptr %1) {{[#0-9]*}} {
// armv64_32-watchos: define hidden swiftcc { float, float, float, float } @"$s8abitypes3FooC3bar{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
Expand Down Expand Up @@ -157,7 +157,7 @@ class Foo {
// armv7-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} {
// armv7-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4
// armv7-ios: load ptr, ptr @"\01L_selector(newRect)", align 4
// armv7-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult
// armv7-ios: call void @objc_msgSend_stret(ptr noalias sret({{.*}}) captures(none) %call.aggresult
// armv7-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1
// armv7-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0
// armv7-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4
Expand All @@ -167,7 +167,7 @@ class Foo {
// armv7s-ios: define hidden swiftcc float @"$s8abitypes3FooC4barc{{[_0-9a-zA-Z]*}}F"(ptr %0, ptr swiftself %1) {{.*}} {
// armv7s-ios: [[RESULT:%.*]] = alloca [[RECTTYPE:%.*MyRect.*]], align 4
// armv7s-ios: load ptr, ptr @"\01L_selector(newRect)", align 4
// armv7s-ios: call void @objc_msgSend_stret(ptr noalias captures(none) sret({{.*}}) %call.aggresult
// armv7s-ios: call void @objc_msgSend_stret(ptr noalias sret({{.*}}) captures(none) %call.aggresult
// armv7s-ios: [[GEP1:%.*]] = getelementptr inbounds [[RECTTYPE]], ptr [[RESULT]], i32 0, i32 1
// armv7s-ios: [[GEP2:%.*]] = getelementptr inbounds {{.*}}, ptr [[GEP1]], i32 0, i32 0
// armv7s-ios: [[RETVAL:%.*]] = load float, ptr [[GEP2]], align 4
Expand All @@ -185,7 +185,7 @@ class Foo {
}

// x86_64-macosx: define hidden swiftcc { double, double, double } @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}F"(ptr swiftself %0) {{.*}} {
// x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2) {{[#0-9]*}} {
// x86_64-macosx: define internal void @"$s8abitypes3FooC3baz{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2) {{[#0-9]*}} {
@objc dynamic func baz() -> Trio {
return Trio(i: 1.0, j: 2.0, k: 3.0)
}
Expand Down Expand Up @@ -480,12 +480,12 @@ class Foo {
return g.invert(b)
}

// x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} {
// x86_64-macosx: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias swifterror captures(none) dereferenceable(8) %2) {{.*}} {
// x86_64-macosx: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8
// x86_64-macosx: call signext i8 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i8 signext {{%[0-9]+}}, ptr {{%[0-9]+}})
// x86_64-macosx: }

// x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias captures(none) swifterror dereferenceable(8) %2) {{.*}} {
// x86_64-ios: define hidden swiftcc void @"$s8abitypes3FooC10throwsTestyySbKF"(i1 %0, ptr swiftself %1, ptr noalias swifterror captures(none) dereferenceable(8) %2) {{.*}} {
// x86_64-ios: [[SEL:%[0-9]+]] = load ptr, ptr @"\01L_selector(negateThrowing:error:)", align 8
// x86_64-ios: call zeroext i1 @objc_msgSend(ptr {{%[0-9]+}}, ptr [[SEL]], i1 zeroext {{%[0-9]+}}, ptr {{%[0-9]+}})
// x86_64-ios: }
Expand Down Expand Up @@ -547,18 +547,18 @@ class Foo {
}

// arm64-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} {
// arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} {
// arm64-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} {
//
// arm64e-ios: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} {
// arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} {
// arm64e-ios: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} {
//
// arm64-tvos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} {
// arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} {
// arm64-tvos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}})captures(none) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} {
// arm64-macosx: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} {
// arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} {
// arm64-macosx: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{.*}} {
//
// arm64-watchos: define hidden swiftcc { i64, i64, i64, i64 } @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}F"(ptr %0, i64 %1, i64 %2, i64 %3, i64 %4, ptr swiftself %5) {{.*}} {
// arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias captures(none) sret({{.*}}) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} {
// arm64-watchos: define internal void @"$s8abitypes3FooC14callJustReturn{{[_0-9a-zA-Z]*}}FTo"(ptr noalias sret({{.*}}) captures(none) %0, ptr %1, ptr %2, ptr %3, ptr %4) {{[#0-9]*}} {
@objc dynamic func callJustReturn(_ r: StructReturns, with v: BigStruct) -> BigStruct {
return r.justReturn(v)
}
Expand Down
4 changes: 2 additions & 2 deletions test/IRGen/addressable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ func getNE(_ holder: Holder) -> NE
@lifetime(&holder)
func getMutNE(_ holder: inout Holder) -> NE

// The parameter cannot be 'nocapture'.
// The parameter cannot be 'captures(none)'.
//
// CHECK-LABEL: define{{.*}} swiftcc void @"$s1A17testAddressableInyAA2NEVAA6HolderVF"(ptr noalias %0)
public func testAddressableIn(_ holder: Holder) -> NE {
getNE(holder)
}

// The parameter cannot be 'nocapture'.
// The parameter cannot be 'captures(none)'.
//
// CHECK-LABEL: define{{.*}} swiftcc void @"$s1A20testAddressableInoutyAA2NEVAA6HolderVzF"(ptr %0)
public func testAddressableInout(_ holder: inout Holder) -> NE {
Expand Down
2 changes: 1 addition & 1 deletion test/IRGen/annotated_cond_fail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public func test(_ a: [Int], _ i: Int) -> Int {

// CHECK: [[SIZE_ADDR:%.*]] = getelementptr
// CHECK: [[SIZE:%.*]] = load i64, ptr [[SIZE_ADDR]]
// CHECK: [[C1:%.*]] = icmp ult i64 [[IDX]], [[SIZE]]
// CHECK: [[C1:%.*]] = icmp samesign ult i64 [[IDX]], [[SIZE]]
// CHECK: br i1 [[C1]], {{.*}}!annotation ![[ARRAY_INDEX_OUT_OF_BOUNDS]]


Expand Down
Loading