Skip to content

Commit d09c2ff

Browse files
committed
Update file check tests
1 parent fea7aeb commit d09c2ff

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

test/Frontend/OptimizationOptions-without-stdlib-checks.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
5757
// In debug mode keep verbose fatal errors.
5858
// DEBUG-LABEL: sil hidden @$S19OptimizationOptions10test_fatal1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
5959
// DEBUG-DAG: "Human nature ..."
60-
// DEBUG-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC:.*fatalErrorMessage.*]] : $@convention(thin)
60+
// DEBUG-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC:.*assertionFailure.*]] : $@convention(thin)
6161
// DEBUG: apply %[[FATAL_ERROR]]({{.*}})
6262
// DEBUG: unreachable
6363

6464
// In playground mode keep verbose fatal errors.
6565
// PLAYGROUND-LABEL: sil hidden @$S19OptimizationOptions10test_fatal1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
6666
// PLAYGROUND-DAG: "Human nature ..."
67-
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC:.*fatalErrorMessage.*]] : $@convention(thin)
67+
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC:.*assertionFailure.*]] : $@convention(thin)
6868
// PLAYGROUND: apply %[[FATAL_ERROR]]({{.*}})
6969
// PLAYGROUND: unreachable
7070

@@ -91,22 +91,22 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
9191
// DEBUG: return
9292

9393
// In playground mode keep verbose library precondition checks.
94-
// PLAYGROUND-LABEL: sil hidden @$S19OptimizationOptions23testprecondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
95-
// PLAYGROUND-DAG: "Fatal error"
94+
// PLAYGROUND-LABEL: sil hidden @$S19OptimizationOptions22testprecondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
95+
// PLAYGROUND-DAG: "Precondition failed"
9696
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
9797
// PLAYGROUND: apply %[[FATAL_ERROR]]({{.*}})
9898
// PLAYGROUND: unreachable
9999
// PLAYGROUND: return
100100

101101
// In release mode keep succinct library precondition checks (trap).
102-
// RELEASE-LABEL: sil hidden @$S19OptimizationOptions23testprecondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
102+
// RELEASE-LABEL: sil hidden @$S19OptimizationOptions22testprecondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
103103
// RELEASE-NOT: "Fatal error"
104104
// RELEASE: %[[V2:.+]] = builtin "xor_Int1"(%{{.+}}, %{{.+}})
105105
// RELEASE: cond_fail %[[V2]]
106106
// RELEASE: return
107107

108108
// In unchecked mode remove library precondition checks.
109-
// UNCHECKED-LABEL: sil hidden @$S19OptimizationOptions23testprecondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
109+
// UNCHECKED-LABEL: sil hidden @$S19OptimizationOptions22testprecondition_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
110110
// UNCHECKED-NOT: "Fatal error"
111111
// UNCHECKED-NOT: builtin "int_trap"
112112
// UNCHECKED-NOT: unreachable
@@ -116,14 +116,14 @@ func test_partial_safety_check(x: Int, y: Int) -> Int {
116116

117117
// In debug mode keep verbose partial safety checks.
118118
// DEBUG-LABEL: sil hidden @$S19OptimizationOptions25test_partial_safety_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
119-
// DEBUG-DAG: "Fatal error"
119+
// DEBUG-DAG: "Assertion failed"
120120
// DEBUG-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
121121
// DEBUG: apply %[[FATAL_ERROR]]({{.*}})
122122
// DEBUG: unreachable
123123

124124
// In playground mode keep verbose partial safety checks.
125125
// PLAYGROUND-LABEL: sil hidden @$S19OptimizationOptions25test_partial_safety_check1x1yS2i_SitF : $@convention(thin) (Int, Int) -> Int {
126-
// PLAYGROUND-DAG: "Fatal error"
126+
// PLAYGROUND-DAG: "Assertion failed"
127127
// PLAYGROUND-DAG: %[[FATAL_ERROR:.+]] = function_ref @[[FATAL_ERROR_FUNC]]
128128
// PLAYGROUND: apply %[[FATAL_ERROR]]({{.*}})
129129
// PLAYGROUND: unreachable

test/SILOptimizer/specialize_checked_cast_branch.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public func ArchetypeToArchetypeCast<T1, T2>(t1 : T1, t2 : T2) -> T2 {
3434
// CHECK: return [[T0]]
3535
//
3636
// CHECK: bb2
37+
// CHECK: builtin "int_trap"
3738
// CHECK: unreachable
3839
// CHECK: } // end sil function '$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1CC_AA1DCTg5'
3940
_ = ArchetypeToArchetypeCast(t1: c, t2: d)
@@ -57,6 +58,7 @@ _ = ArchetypeToArchetypeCast(t1: b, t2: f)
5758
// CHECK-LABEL: sil shared @$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA8NotUInt8V_AA1CCTg5 : $@convention(thin) (NotUInt8, @guaranteed C) -> @owned C {
5859
// CHECK: bb0
5960
// CHECK-NOT: bb1
61+
// CHECK: builtin "int_trap"
6062
// CHECK: unreachable
6163
// CHECK: } // end sil function '$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA8NotUInt8V_AA1CCTg5'
6264
_ = ArchetypeToArchetypeCast(t1: b, t2: c)
@@ -65,6 +67,7 @@ _ = ArchetypeToArchetypeCast(t1: b, t2: c)
6567
// CHECK-LABEL: sil shared @$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1CC_AA8NotUInt8VTg5 : $@convention(thin) (@guaranteed C, NotUInt8) -> NotUInt8 {
6668
// CHECK: bb0
6769
// CHECK-NOT: bb1
70+
// CHECK: builtin "int_trap"
6871
// CHECK: unreachable
6972
// CHECK: } // end sil function '$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1CC_AA8NotUInt8VTg5'
7073
_ = ArchetypeToArchetypeCast(t1: c, t2: b)
@@ -81,6 +84,7 @@ _ = ArchetypeToArchetypeCast(t1: d, t2: c)
8184
// CHECK-LABEL: sil shared @$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1CC_AA1ECTg5 : $@convention(thin) (@guaranteed C, @guaranteed E) -> @owned E {
8285
// CHECK: bb0
8386
// CHECK-NOT: bb1
87+
// CHECK: builtin "int_trap"
8488
// CHECK: unreachable
8589
// CHECK: } // end sil function '$S30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1CC_AA1ECTg5'
8690
_ = ArchetypeToArchetypeCast(t1: c, t2: e)
@@ -131,6 +135,7 @@ _ = ArchetypeToConcreteCastUInt8(t: c)
131135
// CHECK-LABEL: sil shared @$S30specialize_checked_cast_branch28ArchetypeToConcreteCastUInt81tAA03NotI0Vx_tlFAA0J6UInt64V_Tg5 : $@convention(thin) (NotUInt64) -> NotUInt8 {
132136
// CHECK: bb0
133137
// CHECK-NOT: checked_cast_br
138+
// CHECK: builtin "int_trap"
134139
// CHECK: unreachable
135140
_ = ArchetypeToConcreteCastUInt8(t: f)
136141

@@ -162,6 +167,7 @@ _ = ArchetypeToConcreteCastC(t: d)
162167
// E -> C
163168
// CHECK-LABEL: sil shared @$S30specialize_checked_cast_branch24ArchetypeToConcreteCastC1tAA1CCx_tlFAA1EC_Tg5 : $@convention(thin) (@guaranteed E) -> @owned C {
164169
// CHECK: bb0
170+
// CHECK: builtin "int_trap"
165171
// CHECK: unreachable
166172
_ = ArchetypeToConcreteCastC(t: e)
167173

@@ -176,13 +182,15 @@ _ = ArchetypeToConcreteCastC(t: e)
176182
// CHECK: return [[T0]] : $D
177183
//
178184
// CHECK: [[FAIL_BB]]:
185+
// CHECK: builtin "int_trap"
179186
// CHECK: unreachable
180187
// CHECK: } // end sil function '$S30specialize_checked_cast_branch24ArchetypeToConcreteCastD1tAA1DCx_tlFAA1CC_Tg5'
181188
_ = ArchetypeToConcreteCastD(t: c)
182189

183190
// C -> E
184191
// CHECK-LABEL: sil shared @$S30specialize_checked_cast_branch24ArchetypeToConcreteCastE1tAA1ECx_tlFAA1CC_Tg5 : $@convention(thin) (@guaranteed C) -> @owned E {
185192
// CHECK: bb0
193+
// CHECK: builtin "int_trap"
186194
// CHECK: unreachable
187195
_ = ArchetypeToConcreteCastE(t: c)
188196

0 commit comments

Comments
 (0)