forked from swiftlang/swift
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum_empty_payloads.sil
45 lines (36 loc) · 1.56 KB
/
enum_empty_payloads.sil
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// RUN: %target-swift-frontend -emit-ir -verify %s
sil_stage canonical
struct Empty<T> {}
enum SinglePayload<T> {
case A(T)
case B()
case C(Empty<T>)
}
enum MultiPayload<T, U> {
case A(T)
case B(U)
case C()
case D()
case E(Empty<T>)
case F(Empty<U>)
}
sil @project_empty_payloads_single : $@convention(thin) <T> (@in SinglePayload<T>) -> () {
entry(%0 : $*SinglePayload<T>):
%1 = init_enum_data_addr %0 : $*SinglePayload<T>, #SinglePayload.B!enumelt.1
%2 = init_enum_data_addr %0 : $*SinglePayload<T>, #SinglePayload.C!enumelt.1
%3 = unchecked_take_enum_data_addr %0 : $*SinglePayload<T>, #SinglePayload.B!enumelt.1
%4 = unchecked_take_enum_data_addr %0 : $*SinglePayload<T>, #SinglePayload.C!enumelt.1
return undef : $()
}
sil @project_empty_payloads_multi : $@convention(thin) <T, U> (@in MultiPayload<T, U>) -> () {
entry(%0 : $*MultiPayload<T, U>):
%1 = init_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.C!enumelt.1
%2 = init_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.D!enumelt.1
%3 = init_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.E!enumelt.1
%4 = init_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.F!enumelt.1
%5 = unchecked_take_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.C!enumelt.1
%6 = unchecked_take_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.D!enumelt.1
%7 = unchecked_take_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.E!enumelt.1
%8 = unchecked_take_enum_data_addr %0 : $*MultiPayload<T, U>, #MultiPayload.F!enumelt.1
return undef : $()
}