[Mangling/ABI] NFC: Fix test failures uncovered by CI on i386 (IRGen/stdlib/DebugInfo)

This commit is contained in:
Pavel Yaskevich
2017-12-18 17:55:40 -08:00
parent 4885fd4203
commit c18edfc632
7 changed files with 33 additions and 33 deletions

View File

@@ -11,7 +11,7 @@ enum MyError : Error {
// thrown error we create a shadow stack location holding the address of the
// location that holds the pointer to the error instead.
func simple(_ placeholder: Int64) throws -> () {
// CHECK: define {{.*}}void @_T08ErrorVar6simpleys5Int64VKF(i64, %swift.refcounted* swiftself, %swift.error**)
// CHECK: define {{.*}}void @_T08ErrorVar6simpleyys5Int64VKF(i64, %swift.refcounted* swiftself, %swift.error**)
// CHECK: call void @llvm.dbg.declare
// CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[ERROR:[0-9]+]], metadata !DIExpression(DW_OP_deref))
// CHECK: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "_T0s5Error_pD"

View File

@@ -6,7 +6,7 @@ func markUsed<T>(_ t: T) {}
// CHECK: .file [[F:[0-9]+]] "{{.*}}prologue.swift"
func bar<T, U>(_ x: T, y: U) { markUsed("bar") }
// CHECK: __T08prologue3bar_1yyx_q_tr0_lF:
// CHECK: _T08prologue3bar_1yyx_q_tr0_lF:
// CHECK: .loc [[F]] 0 0 prologue_end
// Make sure there is no allocation happening between the end of
// prologue and the beginning of the function body.

View File

@@ -29,54 +29,54 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
}
// In debug mode keep user asserts and runtime checks.
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions11test_assertS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions11test_assert1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// DEBUG: "x smaller than y"
// DEBUG: "Assertion failed"
// DEBUG: cond_fail
// DEBUG: return
// In playground mode keep user asserts and runtime checks.
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions11test_assertS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions11test_assert1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND: "x smaller than y"
// PLAYGROUND: "Assertion failed"
// PLAYGROUND: cond_fail
// In release mode remove user asserts and keep runtime checks.
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions11test_assertS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions11test_assert1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-NOT: "x smaller than y"
// RELEASE-NOT: "Assertion failed"
// RELEASE: cond_fail
// In fast mode remove user asserts and runtime checks.
// FAST-LABEL: sil hidden @_T019OptimizationOptions11test_assertS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// FAST-LABEL: sil hidden @_T019OptimizationOptions11test_assert1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// FAST-NOT: "x smaller than y"
// FAST-NOT: "Assertion failed"
// FAST-NOT: cond_fail
// In debug mode keep verbose fatal errors.
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions10test_fatalS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions10test_fatal1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-DAG: "Human nature ..."
// DEBUG-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC:.*fatalErrorMessage.*]] : $@convention(thin)
// DEBUG: apply %[[FATAL_ERROR]]({{.*}})
// DEBUG: unreachable
// In playground mode keep verbose fatal errors.
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions10test_fatalS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions10test_fatal1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-DAG: "Human nature ..."
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC:.*fatalErrorMessage.*]] : $@convention(thin)
// PLAYGROUND: apply %[[FATAL_ERROR]]({{.*}})
// PLAYGROUND: unreachable
// In release mode keep succinct fatal errors (trap).
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions10test_fatalS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions10test_fatal1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-NOT: "Human nature ..."
// RELEASE-NOT: "Fatal error"
// RELEASE: cond_fail
// RELEASE: return
// In fast mode remove fatal errors.
// FAST-LABEL: sil hidden @_T019OptimizationOptions10test_fatalS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// FAST-LABEL: sil hidden @_T019OptimizationOptions10test_fatal1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// FAST-NOT: "Human nature ..."
// FAST-NOT: "Fatal error"
// FAST-NOT: int_trap
@@ -84,7 +84,7 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
// Precondition safety checks.
// In debug mode keep verbose library precondition checks.
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-DAG: "Fatal error"
// DEBUG-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
// DEBUG: apply %[[FATAL_ERROR]]({{.*}})
@@ -92,7 +92,7 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
// DEBUG: return
// In playground mode keep verbose library precondition checks.
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-DAG: "Fatal error"
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
// PLAYGROUND: apply %[[FATAL_ERROR]]({{.*}})
@@ -100,14 +100,14 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
// PLAYGROUND: return
// In release mode keep succinct library precondition checks (trap).
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-NOT: "Fatal error"
// RELEASE: %[[V2:.+]] = builtin "xor_Int1"(%{{.+}}, %{{.+}})
// RELEASE: cond_fail %[[V2]]
// RELEASE: return
// In unchecked mode remove library precondition checks.
// UNCHECKED-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// UNCHECKED-LABEL: sil hidden @_T019OptimizationOptions23test_precondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// UNCHECKED-NOT: "Fatal error"
// UNCHECKED-NOT: builtin "int_trap"
// UNCHECKED-NOT: unreachable
@@ -116,28 +116,28 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
// Partial safety checks.
// In debug mode keep verbose partial safety checks.
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// DEBUG-DAG: "Fatal error"
// DEBUG-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
// DEBUG: apply %[[FATAL_ERROR]]({{.*}})
// DEBUG: unreachable
// In playground mode keep verbose partial safety checks.
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// PLAYGROUND-DAG: "Fatal error"
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
// PLAYGROUND: apply %[[FATAL_ERROR]]({{.*}})
// PLAYGROUND: unreachable
// In release mode remove partial safety checks.
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// RELEASE-NOT: "Fatal error"
// RELEASE-NOT: builtin "int_trap"
// RELEASE-NOT: unreachable
// RELEASE: return
// In fast mode remove partial safety checks.
// FAST-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_checkS2i1x_Si1ytF : $@convention(thin) (Int, Int) -> Int {
// FAST-LABEL: sil hidden @_T019OptimizationOptions25test_partial_safety_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
// FAST-NOT: "Fatal error"
// FAST-NOT: builtin "int_trap"
// FAST-NOT: unreachable

View File

@@ -291,9 +291,9 @@ class Foo {
// i386-watchos: define hidden swiftcc i1 @_T08abitypes3FooC6negate{{[_0-9a-zA-Z]*}}F(i1, %T8abitypes3FooC* swiftself)
// i386-watchos: define hidden zeroext i1 @_T08abitypes3FooC6negate{{[_0-9a-zA-Z]*}}FTo
// i386-watchos: [[R1:%[0-9]+]] = call swiftcc i1 @_T010ObjectiveC22_convertObjCBoolToBoolSbAA0cD0VF(i1 %2)
// i386-watchos: [[R1:%[0-9]+]] = call swiftcc i1 @_T010ObjectiveC22_convertObjCBoolToBoolySbAA0cD0VF(i1 %2)
// i386-watchos: [[R2:%[0-9]+]] = call swiftcc i1 @_T08abitypes3FooC6negate{{[_0-9a-zA-Z]*}}F(i1 [[R1]]
// i386-watchos: [[R3:%[0-9]+]] = call swiftcc i1 @_T010ObjectiveC22_convertBoolToObjCBoolAA0eF0VSbF(i1 [[R2]])
// i386-watchos: [[R3:%[0-9]+]] = call swiftcc i1 @_T010ObjectiveC22_convertBoolToObjCBoolyAA0eF0VSbF(i1 [[R2]])
// i386-watchos: ret i1 [[R3]]
dynamic func negate(_ b: Bool) -> Bool {
@@ -423,13 +423,13 @@ class Foo {
// x86_64-macosx: ret i1 [[NEG]]
// x86_64-macosx: }
// x86_64-ios: define hidden swiftcc i1 @_T08abitypes3FooC7negate3S2bF(i1, %T8abitypes3FooC* swiftself) {{.*}} {
// x86_64-ios: define hidden swiftcc i1 @_T08abitypes3FooC7negate3yS2bF(i1, %T8abitypes3FooC* swiftself) {{.*}} {
// x86_64-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(invert:)", align 8
// x86_64-ios: [[NEG:%[0-9]+]] = call zeroext i1 bitcast (void ()* @objc_msgSend to i1 (%1*, i8*, i1)*)(%1* [[RECEIVER:%[0-9]+]], i8* [[SEL]], i1 zeroext %0)
// x86_64-ios: ret i1 [[NEG]]
// x86_64-ios: }
// i386-ios: define hidden swiftcc i1 @_T08abitypes3FooC7negate3S2bF(i1, %T8abitypes3FooC* swiftself) {{.*}} {
// i386-ios: define hidden swiftcc i1 @_T08abitypes3FooC7negate3yS2bF(i1, %T8abitypes3FooC* swiftself) {{.*}} {
// i386-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(invert:)", align 4
// i386-ios: [[NEG:%[0-9]+]] = call zeroext i1 bitcast (void ()* @objc_msgSend to i1 (%1*, i8*, i1)*)(%1* [[RECEIVER:%[0-9]+]], i8* [[SEL]], i1 zeroext %0)
// i386-ios: ret i1 [[NEG]]
@@ -445,12 +445,12 @@ class Foo {
// x86_64-macosx: call signext i8 bitcast (void ()* @objc_msgSend to i8 (%1*, i8*, i8, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i8 signext {{%[0-9]+}}, %2** {{%[0-9]+}})
// x86_64-macosx: }
// x86_64-ios: define hidden swiftcc void @_T08abitypes3FooC10throwsTestySbKF(i1, %T8abitypes3FooC* swiftself, %swift.error** swifterror) {{.*}} {
// x86_64-ios: define hidden swiftcc void @_T08abitypes3FooC10throwsTestyySbKF(i1, %T8abitypes3FooC* swiftself, %swift.error** swifterror) {{.*}} {
// x86_64-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 8
// x86_64-ios: call zeroext i1 bitcast (void ()* @objc_msgSend to i1 (%1*, i8*, i1, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i1 zeroext {{%[0-9]+}}, %2** {{%[0-9]+}})
// x86_64-ios: }
// i386-ios: define hidden swiftcc void @_T08abitypes3FooC10throwsTestySbKF(i1, %T8abitypes3FooC* swiftself, %swift.error**) {{.*}} {
// i386-ios: define hidden swiftcc void @_T08abitypes3FooC10throwsTestyySbKF(i1, %T8abitypes3FooC* swiftself, %swift.error**) {{.*}} {
// i386-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 4
// i386-ios: call signext i8 bitcast (void ()* @objc_msgSend to i8 (%1*, i8*, i8, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i8 signext {{%[0-9]+}}, %2** {{%[0-9]+}})
// i386-ios: }

View File

@@ -5,7 +5,7 @@
// CHECK-LABEL: sil @{{.*}}testInt
// CHECK-NOT: apply
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyxFSi_Tg
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyyxFSi_Tg5
// CHECK-NOT: apply
// CHECK: apply [[F]]
// CHECK-NEXT: tuple
@@ -16,10 +16,10 @@ public func testInt(_ a: inout [Int]) {
// CHECK-LABEL: sil @{{.*}}testThreeInt
// CHECK-NOT: apply
// CHECK: [[FR:%[0-9]+]] = function_ref @_T0Sa15reserveCapacityySiFSi_Tg5
// CHECK: [[FR:%[0-9]+]] = function_ref @_T0Sa15reserveCapacityyySiFSi_Tg5
// CHECK-NEXT: apply [[FR]]
// CHECK-NOT: apply
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyxFSi_Tg
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyyxFSi_Tg5
// CHECK-NOT: apply
// CHECK: apply [[F]]
// CHECK-NEXT: apply [[F]]
@@ -32,7 +32,7 @@ public func testThreeInts(_ a: inout [Int]) {
// CHECK-LABEL: sil @{{.*}}testTooManyInts
// CHECK-NOT: apply
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyqd__10contentsOf_t7ElementQyd__Rszs8SequenceRd__lFSi_SaySiGTg5
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6append10contentsOfyqd___t7ElementQyd__Rszs8SequenceRd__lFSi_SaySiGTg5Tf4gn_n
// CHECK-NOT: apply
// CHECK: apply [[F]]
// CHECK-NOT: apply
@@ -43,7 +43,7 @@ public func testTooManyInts(_ a: inout [Int]) {
// CHECK-LABEL: sil @{{.*}}testString
// CHECK-NOT: apply
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyxFSS_Tg
// CHECK: [[F:%[0-9]+]] = function_ref @_T0Sa6appendyyxFSS_Tg5
// CHECK-NOT: apply
// CHECK: apply [[F]]
// CHECK-NOT: apply

View File

@@ -145,7 +145,7 @@
{
key.kind: source.lang.swift.decl.function.method.instance,
key.name: "test_startsWithTest_butTakesAParam(param:)",
key.usr: "s:23index_is_test_candidate7MyClassC0C30_startsWithTest_butTakesAParamySi5param_tF",
key.usr: "s:23index_is_test_candidate7MyClassC0C30_startsWithTest_butTakesAParam5paramySi_tF",
key.line: 22,
key.column: 8,
key.is_dynamic: 1,

View File

@@ -33,9 +33,9 @@ func testConstantFoldFloatLiterals() {
#endif
}
// i386: call swiftcc void @_T015FloatingPointIR13acceptFloat32ySfF{{.*}}(float 1.000000e+00)
// i386: call swiftcc void @_T015FloatingPointIR13acceptFloat64ySdF{{.*}}(double 1.000000e+00)
// i386: call swiftcc void @_T015FloatingPointIR13acceptFloat80ys0E0VF{{.*}}(x86_fp80 0xK3FFF8000000000000000)
// i386: call swiftcc void @_T015FloatingPointIR13acceptFloat32yySfF{{.*}}(float 1.000000e+00)
// i386: call swiftcc void @_T015FloatingPointIR13acceptFloat64yySdF{{.*}}(double 1.000000e+00)
// i386: call swiftcc void @_T015FloatingPointIR13acceptFloat80yys0E0VF{{.*}}(x86_fp80 0xK3FFF8000000000000000)
// x86_64: call swiftcc void @_T015FloatingPointIR13acceptFloat32yySfF{{.*}}(float 1.000000e+00)
// x86_64: call swiftcc void @_T015FloatingPointIR13acceptFloat64yySdF{{.*}}(double 1.000000e+00)