Skip to content

Commit 9c39793

Browse files
authored
Merge pull request #7821 from eeckstein/convert-tests
2 parents e0e424a + 1282c6a commit 9c39793

14 files changed

+184
-184
lines changed

test/IRGen/associated_types.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct Owl<T : Runcible, U> {
3030
class Pussycat<T : Runcible, U> {
3131
init() {}
3232

33-
// CHECK: define hidden swiftcc void @_T016associated_types8PussycatC3eat{{[_0-9a-zA-Z]*}}F(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %C16associated_types8Pussycat* swiftself)
33+
// CHECK: define hidden swiftcc void @_T016associated_types8PussycatC3eat{{[_0-9a-zA-Z]*}}F(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %T16associated_types8PussycatC* swiftself)
3434
func eat(_ what: T.RuncerType.Runcee, and: T.RuncerType, with: T) { }
3535
}
3636

test/IRGen/bitcast.sil

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,20 @@ sil_vtable C {}
1616

1717
protocol CP: class {}
1818

19-
// CHECK-i386-LABEL: define{{( protected)?}} swiftcc i32 @bitcast_trivial(%C7bitcast1C*) {{.*}} {
20-
// CHECK-i386: [[BUF:%.*]] = alloca %C7bitcast1C*, align 4
21-
// CHECK-i386: store %C7bitcast1C* %0, %C7bitcast1C** [[BUF]]
22-
// CHECK-i386: [[OUT_BUF:%.*]] = bitcast %C7bitcast1C** [[BUF]] to %Si*
23-
// CHECK-i386: [[VALUE_BUF:%.*]] = getelementptr inbounds %Si, %Si* [[OUT_BUF]], i32 0, i32 0
19+
// CHECK-i386-LABEL: define{{( protected)?}} swiftcc i32 @bitcast_trivial(%T7bitcast1CC*) {{.*}} {
20+
// CHECK-i386: [[BUF:%.*]] = alloca %T7bitcast1CC*, align 4
21+
// CHECK-i386: store %T7bitcast1CC* %0, %T7bitcast1CC** [[BUF]]
22+
// CHECK-i386: [[OUT_BUF:%.*]] = bitcast %T7bitcast1CC** [[BUF]] to %TSi*
23+
// CHECK-i386: [[VALUE_BUF:%.*]] = getelementptr inbounds %TSi, %TSi* [[OUT_BUF]], i32 0, i32 0
2424
// CHECK-i386: [[VALUE:%.*]] = load i32, i32* [[VALUE_BUF]], align 4
2525
// CHECK-i386: ret i32 [[VALUE]]
2626
// CHECK-i386: }
2727

28-
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc i64 @bitcast_trivial(%C7bitcast1C*) {{.*}} {
29-
// CHECK-x86_64: [[BUF:%.*]] = alloca %C7bitcast1C*, align 8
30-
// CHECK-x86_64: store %C7bitcast1C* %0, %C7bitcast1C** [[BUF]]
31-
// CHECK-x86_64: [[OUT_BUF:%.*]] = bitcast %C7bitcast1C** [[BUF]] to %Si*
32-
// CHECK-x86_64: [[VALUE_BUF:%.*]] = getelementptr inbounds %Si, %Si* [[OUT_BUF]], i32 0, i32 0
28+
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc i64 @bitcast_trivial(%T7bitcast1CC*) {{.*}} {
29+
// CHECK-x86_64: [[BUF:%.*]] = alloca %T7bitcast1CC*, align 8
30+
// CHECK-x86_64: store %T7bitcast1CC* %0, %T7bitcast1CC** [[BUF]]
31+
// CHECK-x86_64: [[OUT_BUF:%.*]] = bitcast %T7bitcast1CC** [[BUF]] to %TSi*
32+
// CHECK-x86_64: [[VALUE_BUF:%.*]] = getelementptr inbounds %TSi, %TSi* [[OUT_BUF]], i32 0, i32 0
3333
// CHECK-x86_64: [[VALUE:%.*]] = load i64, i64* [[VALUE_BUF]], align 8
3434
// CHECK-x86_64: ret i64 [[VALUE]]
3535
// CHECK-x86_64: }
@@ -54,15 +54,15 @@ entry(%c : $Optional<Int>):
5454
return %i : $Optional<Int>
5555
}
5656

57-
// CHECK-i386-LABEL: define{{( protected)?}} swiftcc i32 @bitcast_ref(%C7bitcast1C*) {{.*}} {
57+
// CHECK-i386-LABEL: define{{( protected)?}} swiftcc i32 @bitcast_ref(%T7bitcast1CC*) {{.*}} {
5858
// CHECK-i386-NEXT: entry:
59-
// CHECK-i386-NEXT: [[VALUE:%.*]] = ptrtoint %C7bitcast1C* %0 to i32
59+
// CHECK-i386-NEXT: [[VALUE:%.*]] = ptrtoint %T7bitcast1CC* %0 to i32
6060
// CHECK-i386-NEXT: ret i32 [[VALUE]]
6161
// CHECK-i386-NEXT: }
6262

63-
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc i64 @bitcast_ref(%C7bitcast1C*) {{.*}} {
63+
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc i64 @bitcast_ref(%T7bitcast1CC*) {{.*}} {
6464
// CHECK-x86_64-NEXT: entry:
65-
// CHECK-x86_64-NEXT: [[VALUE:%.*]] = ptrtoint %C7bitcast1C* %0 to i64
65+
// CHECK-x86_64-NEXT: [[VALUE:%.*]] = ptrtoint %T7bitcast1CC* %0 to i64
6666
// CHECK-x86_64-NEXT: ret i64 [[VALUE]]
6767
// CHECK-x86_64-NEXT: }
6868
sil @bitcast_ref: $@convention(thin) (C) -> Optional<C> {
@@ -88,12 +88,12 @@ bb0(%0 : $Optional<C>):
8888

8989
// CHECK-x86_64-LABEL: define hidden swiftcc i64 @unchecked_bitwise_cast(i64, i64) {{.*}} {
9090
// CHECK-x86_64-NEXT: entry:
91-
// CHECK-x86_64-NEXT: alloca <{ %Si, %Si }>, align 8
91+
// CHECK-x86_64-NEXT: alloca <{ %TSi, %TSi }>, align 8
9292
// A bunch of GEPs happen here to get from Int to int.
9393
// CHECK-x86_64: store i64 %{{.*}}, i64* %bitcast.elt._value, align 8
9494
// CHECK-x86_64: store i64 %{{.*}}, i64* %bitcast.elt1._value, align 8
95-
// CHECK-x86_64-NEXT: %{{.*}} = bitcast <{ %Si, %Si }>* %bitcast to %Si*
96-
// CHECK-x86_64-NEXT: [[VAL:%.*]] = getelementptr inbounds %Si, %Si* %{{.*}}, i32 0, i32 0
95+
// CHECK-x86_64-NEXT: %{{.*}} = bitcast <{ %TSi, %TSi }>* %bitcast to %TSi*
96+
// CHECK-x86_64-NEXT: [[VAL:%.*]] = getelementptr inbounds %TSi, %TSi* %{{.*}}, i32 0, i32 0
9797
// CHECK-x86_64-NEXT: [[RESULT:%.*]] = load i64, i64* [[VAL]], align 8
9898
// CHECK-x86_64: ret i64 [[RESULT]]
9999
// CHECK-x86_64-NEXT: }
@@ -107,7 +107,7 @@ bb0(%0 : $Int, %1 : $Int):
107107
// CHECK-x86_64-LABEL: define hidden swiftcc i64 @trivial_bitwise_cast(i64, i64) {{.*}} {
108108
// CHECK-x86_64-NOT: trap
109109
// CHECK-x86_64-NOT: unreachable
110-
// CHECK-x86_64: bitcast <{ %Si, %Si }>* %bitcast to %Si*
110+
// CHECK-x86_64: bitcast <{ %TSi, %TSi }>* %bitcast to %TSi*
111111
// CHECK-x86_64: ret
112112
sil hidden [noinline] @trivial_bitwise_cast : $@convention(thin) (Int, Int) -> Int {
113113
bb0(%0 : $Int, %1 : $Int):
@@ -131,11 +131,11 @@ bb0(%0 : $*U, %1 : $*T):
131131
}
132132

133133
// CHECK-i386-LABEL: define{{( protected)?}} swiftcc i32 @unchecked_ref_cast_class_optional
134-
// CHECK-i386: ptrtoint %C7bitcast1A* %0 to i32
134+
// CHECK-i386: ptrtoint %T7bitcast1AC* %0 to i32
135135
// CHECK-i386-NEXT: ret i32
136136

137137
// CHECK-x86_64-LABEL: define{{( protected)?}} swiftcc i64 @unchecked_ref_cast_class_optional
138-
// CHECK-x86_64: ptrtoint %C7bitcast1A* %0 to i64
138+
// CHECK-x86_64: ptrtoint %T7bitcast1AC* %0 to i64
139139
// CHECK-x86_64-NEXT: ret i64
140140
sil @unchecked_ref_cast_class_optional : $@convention(thin) (@owned A) -> @owned Optional<AnyObject> {
141141
bb0(%0 : $A):

test/IRGen/casts.sil

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class B: A {}
1616
sil_vtable A {}
1717
sil_vtable B {}
1818

19-
// CHECK-LABEL: define{{( protected)?}} swiftcc %C5casts1B* @unchecked_addr_cast(%C5casts1A** noalias nocapture dereferenceable({{.*}})) {{.*}} {
20-
// CHECK: bitcast %C5casts1A** %0 to %C5casts1B**
19+
// CHECK-LABEL: define{{( protected)?}} swiftcc %T5casts1BC* @unchecked_addr_cast(%T5casts1AC** noalias nocapture dereferenceable({{.*}})) {{.*}} {
20+
// CHECK: bitcast %T5casts1AC** %0 to %T5casts1BC**
2121
sil @unchecked_addr_cast : $(@in A) -> B {
2222
entry(%a : $*A):
2323
%b = unchecked_addr_cast %a : $*A to $*B
@@ -207,7 +207,7 @@ nay:
207207
unreachable
208208
}
209209

210-
// CHECK-LABEL: define{{( protected)?}} swiftcc %objc_object* @checked_upcast(%C5casts1A*) {{.*}} {
210+
// CHECK-LABEL: define{{( protected)?}} swiftcc %objc_object* @checked_upcast(%T5casts1AC*) {{.*}} {
211211
// -- Don't need to check conformance of an object to AnyObject.
212212
// CHECK-NOT: call %objc_object* @swift_dynamicCastObjCProtocolConditional
213213
// CHECK: phi %objc_object*
@@ -220,14 +220,14 @@ nay:
220220
unreachable
221221
}
222222

223-
// CHECK-LABEL: define{{( protected)?}} swiftcc %C5casts1A* @checked_downcast_optional({{(i32|i64)}}) {{.*}} {
224-
// CHECK: [[T0:%.*]] = inttoptr {{(i32|i64)}} %0 to %C5casts1A*
225-
// CHECK: [[OBJ_PTR:%.*]] = bitcast %C5casts1A* [[T0]] to i8*
223+
// CHECK-LABEL: define{{( protected)?}} swiftcc %T5casts1AC* @checked_downcast_optional({{(i32|i64)}}) {{.*}} {
224+
// CHECK: [[T0:%.*]] = inttoptr {{(i32|i64)}} %0 to %T5casts1AC*
225+
// CHECK: [[OBJ_PTR:%.*]] = bitcast %T5casts1AC* [[T0]] to i8*
226226
// CHECK: [[METADATA:%.*]] = call %swift.type* @_T05casts1ACMa()
227227
// CHECK: [[METADATA_PTR:%.*]] = bitcast %swift.type* [[METADATA]] to i8*
228228
// CHECK: [[RESULT_PTR:%.*]] = call i8* @swift_rt_swift_dynamicCastClass(i8* [[OBJ_PTR]], i8* [[METADATA_PTR]])
229-
// CHECK: [[RESULT:%.*]] = bitcast i8* [[RESULT_PTR]] to %C5casts1A*
230-
// CHECK: [[COND:%.*]] = icmp ne %C5casts1A* [[RESULT]], null
229+
// CHECK: [[RESULT:%.*]] = bitcast i8* [[RESULT_PTR]] to %T5casts1AC*
230+
// CHECK: [[COND:%.*]] = icmp ne %T5casts1AC* [[RESULT]], null
231231
// CHECK: br i1 [[COND]]
232232
sil @checked_downcast_optional : $@convention(thin) (Optional<A>) -> @owned A {
233233
entry(%a : $Optional<A>):
@@ -317,15 +317,15 @@ entry(%x : $OB):
317317
return %x : $OB
318318
}
319319

320-
// CHECK-LABEL: define{{( protected)?}} swiftcc %C5casts1B* @checked_object_to_object_casts(%C5casts1A*)
320+
// CHECK-LABEL: define{{( protected)?}} swiftcc %T5casts1BC* @checked_object_to_object_casts(%T5casts1AC*)
321321
// CHECK: @swift_dynamicCastClassUnconditional
322322
sil @checked_object_to_object_casts : $@convention(thin) (A) -> B {
323323
entry(%a : $A):
324324
%b = unconditional_checked_cast %a : $A to $B
325325
return %b : $B
326326
}
327327

328-
// CHECK-LABEL: define{{( protected)?}} swiftcc %C5casts2OB* @checked_objc_object_to_object_casts(%C5casts2OA*)
328+
// CHECK-LABEL: define{{( protected)?}} swiftcc %T5casts2OBC* @checked_objc_object_to_object_casts(%T5casts2OAC*)
329329
// CHECK: @swift_dynamicCastClassUnconditional
330330
sil @checked_objc_object_to_object_casts : $@convention(thin) (OA) -> OB {
331331
entry(%a : $OA):

test/IRGen/cf.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// REQUIRES: objc_interop
55

66
// CHECK: [[TYPE:%swift.type]] = type
7-
// CHECK: [[REFRIGERATOR:%CSo14CCRefrigerator]] = type
7+
// CHECK: [[REFRIGERATOR:%TSo14CCRefrigeratorC]] = type
88
// CHECK: [[OBJC:%objc_object]] = type
99

1010
// CHECK: [[REFRIGERATOR_NAME:@.*]] = private unnamed_addr constant [20 x i8] c"So14CCRefrigeratorC\00"

test/IRGen/clang_inline.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ import Empty
2121

2222
import gizmo
2323

24-
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline16CallStaticInlineC10ReturnZeros5Int64VyF(%C12clang_inline16CallStaticInline* swiftself) {{.*}} {
24+
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline16CallStaticInlineC10ReturnZeros5Int64VyF(%T12clang_inline16CallStaticInlineC* swiftself) {{.*}} {
2525
class CallStaticInline {
2626
func ReturnZero() -> Int64 { return Int64(zero()) }
2727
}
2828

2929
// CHECK-LABEL: define internal i32 @zero()
3030
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
3131

32-
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline17CallStaticInline2C10ReturnZeros5Int64VyF(%C12clang_inline17CallStaticInline2* swiftself) {{.*}} {
32+
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline17CallStaticInline2C10ReturnZeros5Int64VyF(%T12clang_inline17CallStaticInline2C* swiftself) {{.*}} {
3333
class CallStaticInline2 {
3434
func ReturnZero() -> Int64 { return Int64(wrappedZero()) }
3535
}

test/IRGen/clang_inline_reverse.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
import gizmo
99

10-
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline16CallStaticInlineC10ReturnZeros5Int64VyF(%C12clang_inline16CallStaticInline* swiftself) {{.*}} {
10+
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline16CallStaticInlineC10ReturnZeros5Int64VyF(%T12clang_inline16CallStaticInlineC* swiftself) {{.*}} {
1111
class CallStaticInline {
1212
func ReturnZero() -> Int64 { return Int64(wrappedZero()) }
1313
}
1414

1515
// CHECK-LABEL: define internal i32 @wrappedZero() {{#[0-9]+}} {
1616

17-
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline17CallStaticInline2C10ReturnZeros5Int64VyF(%C12clang_inline17CallStaticInline2* swiftself) {{.*}} {
17+
// CHECK-LABEL: define hidden swiftcc i64 @_T012clang_inline17CallStaticInline2C10ReturnZeros5Int64VyF(%T12clang_inline17CallStaticInline2C* swiftself) {{.*}} {
1818
class CallStaticInline2 {
1919
func ReturnZero() -> Int64 { return Int64(zero()) }
2020
}

test/IRGen/dynamic_cast.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct S {
1717
var v: Int
1818
}
1919

20-
// CHECK: [[INT:%Si]] = type <{ [[LLVM_PTRSIZE_INT:i(32|64)]] }>
20+
// CHECK: [[INT:%TSi]] = type <{ [[LLVM_PTRSIZE_INT:i(32|64)]] }>
2121

2222
// CHECK-LABEL: define{{( protected)?}} swiftcc void @testUnconditional0(
2323
sil @testUnconditional0 : $@convention(thin) (@in P) -> () {

0 commit comments

Comments
 (0)