33import Builtin
44
55// -- Singleton enum. The representation is just the singleton payload.
6- // CHECK: %O4enum9Singleton = type { { i64, i64 } }
6+ // CHECK: %O4enum9Singleton = type <{ < { i64, i64 }> }>
77
88// -- No-payload enums. The representation is just an enum tag.
9- // CHECK: %O4enum10NoPayloads = type { i2 }
10- // CHECK: %O4enum11NoPayloads2 = type { i3 }
9+ // CHECK: %O4enum10NoPayloads = type < { i2 }>
10+ // CHECK: %O4enum11NoPayloads2 = type < { i3 }>
1111
1212// -- Single-payload enum, no extra inhabitants in the payload type. The
1313// representation adds a tag bit to distinguish payload from enum tag:
1414// case x(i64): X0 X1 X2 ... X63 | 0, where X0...X63 are the payload bits
1515// case y: 0 0 0 ... 0 | 1
1616// case z: 1 0 0 ... 0 | 1
17- // CHECK: %O4enum17SinglePayloadNoXI = type { i64, i1 }
18- // CHECK: %O4enum18SinglePayloadNoXI2 = type { i64, i1 }
17+ // CHECK: %O4enum17SinglePayloadNoXI = type < { i64, i1 }>
18+ // CHECK: %O4enum18SinglePayloadNoXI2 = type < { i64, i1 }>
1919
2020// -- Single-payload enum, spare bits. The representation uses a tag bit
2121// out of the payload to distinguish payload from enum tag:
2222// case x(i3): X0 X1 X2 0 0 0 0 0
2323// case y: 0 0 0 1 0 0 0 0
2424// case z: 1 0 0 1 0 0 0 0
25- // CHECK: %O4enum21SinglePayloadSpareBit = type { i64 }
25+ // CHECK: %O4enum21SinglePayloadSpareBit = type < { i64 }>
2626
2727// -- Single-payload enum containing a no-payload enum as its payload.
2828// The representation takes extra inhabitants starting after the greatest
2929// discriminator value used by the nested no-payload enum.
30- // CHECK: %O4enum19SinglePayloadNested = type { i8 }
30+ // CHECK: %O4enum19SinglePayloadNested = type < { i8 }>
3131
3232// -- Single-payload enum containing another single-payload enum as its
3333// payload.
3434// The representation takes extra inhabitants from the nested enum's payload
3535// that were unused by the nested enum.
36- // CHECK: %O4enum25SinglePayloadNestedNested = type { i8 }
36+ // CHECK: %O4enum25SinglePayloadNestedNested = type < { i8 }>
3737
3838// -- Multi-payload enum, no spare bits. The representation adds tag bits
3939// to discriminate payloads. No-payload cases all share a tag.
@@ -43,7 +43,7 @@ import Builtin
4343// case a: 0 0 0 ... 0 0 | 1 1
4444// case b: 1 0 0 ... 0 0 | 1 1
4545// case c: 0 1 0 ... 0 0 | 1 1
46- // CHECK: %O4enum23MultiPayloadNoSpareBits = type { i64, i2 }
46+ // CHECK: %O4enum23MultiPayloadNoSpareBits = type < { i64, i2 }>
4747
4848// -- Multi-payload enum, one spare bit. The representation uses spare bits
4949// common to all payloads to partially discriminate payloads, with added
@@ -54,7 +54,7 @@ import Builtin
5454// case a: 0 0 0 0 0 0 0 1 | 1
5555// case b: 1 0 0 0 0 0 0 1 | 1
5656// case c: 0 1 0 0 0 0 0 1 | 1
57- // CHECK: %O4enum23MultiPayloadOneSpareBit = type { i64, i1 }
57+ // CHECK: %O4enum23MultiPayloadOneSpareBit = type < { i64, i1 }>
5858
5959// -- Multi-payload enum, two spare bits. Same as above, except we have enough
6060// spare bits not to require any added tag bits.
@@ -64,12 +64,12 @@ import Builtin
6464// case a: 0 0 0 0 0 0 1 1
6565// case b: 1 0 0 0 0 0 1 1
6666// case c: 0 1 0 0 0 0 1 1
67- // CHECK: %O4enum24MultiPayloadTwoSpareBits = type { i64 }
67+ // CHECK: %O4enum24MultiPayloadTwoSpareBits = type < { i64 }>
6868
6969// -- Dynamic enums. The type layout is opaque; we dynamically bitcast to
7070// the element type.
71- // CHECK: %O4enum20DynamicSinglePayload = type {}
72- // CHECK: %O4enum16DynamicSingleton = type {}
71+ // CHECK: %O4enum20DynamicSinglePayload = type <{}>
72+ // CHECK: %O4enum16DynamicSingleton = type <{}>
7373
7474// -- Dynamic metadata template carries a value witness table pattern
7575// we fill in on instantiation.
@@ -174,10 +174,10 @@ dest(%u2 : $(Builtin.Int64, Builtin.Int64)):
174174// CHECK: entry:
175175// CHECK: br label %[[PREDEST:[0-9]+]]
176176// CHECK: ; <label>:[[PREDEST]]
177- // CHECK: [[ADDR:%.*]] = bitcast %O4enum9Singleton* %0 to { i64, i64 }*
177+ // CHECK: [[ADDR:%.*]] = bitcast %O4enum9Singleton* %0 to < { i64, i64 }> *
178178// CHECK: br label %[[DEST:[0-9]+]]
179179// CHECK: ; <label>:[[DEST]]
180- // CHECK: phi { i64, i64 }* [ [[ADDR]], %[[PREDEST]] ]
180+ // CHECK: phi < { i64, i64 }> * [ [[ADDR]], %[[PREDEST]] ]
181181// CHECK: ret void
182182// CHECK: }
183183sil @singleton_switch_indirect : $([inout] Singleton) -> () {
@@ -203,10 +203,10 @@ entry(%0 : $Builtin.Int64, %1 : $Builtin.Int64):
203203
204204// CHECK: define void @singleton_inject_indirect(i64, i64, %O4enum9Singleton*) {
205205// CHECK: entry:
206- // CHECK: [[DATA_ADDR:%.*]] = bitcast %O4enum9Singleton* %2 to { i64, i64 }*
207- // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds { i64, i64 }* [[DATA_ADDR]], i32 0, i32 0
206+ // CHECK: [[DATA_ADDR:%.*]] = bitcast %O4enum9Singleton* %2 to < { i64, i64 }> *
207+ // CHECK: [[DATA_0_ADDR:%.*]] = getelementptr inbounds < { i64, i64 }> * [[DATA_ADDR]], i32 0, i32 0
208208// CHECK: store i64 %0, i64* [[DATA_0_ADDR]], align 8
209- // CHECK: [[DATA_1_ADDR:%.*]] = getelementptr inbounds { i64, i64 }* [[DATA_ADDR]], i32 0, i32 1
209+ // CHECK: [[DATA_1_ADDR:%.*]] = getelementptr inbounds < { i64, i64 }> * [[DATA_ADDR]], i32 0, i32 1
210210// CHECK: store i64 %1, i64* [[DATA_1_ADDR]], align 8
211211// CHECK: ret void
212212// CHECK: }
0 commit comments