1
1
// RUN: %target-sil-opt -test-runner %s -o /dev/null 2>&1 | %FileCheck %s
2
2
3
- // rdar://124466060
4
- // UNSUPPORTED: CPU=armv7k
5
-
6
3
sil_stage raw
7
4
8
5
import Builtin
9
6
import Swift
10
7
import SwiftShims
11
8
9
+ struct FakeInt {
10
+ var i: Builtin.Int32
11
+ }
12
+
12
13
@_moveOnly struct MO_DEINIT {
13
- @_hasStorage var value: Int { get set }
14
+ @_hasStorage var value: FakeInt { get set }
14
15
deinit
15
- init(value: Int )
16
+ init(value: FakeInt )
16
17
}
17
18
18
19
struct NC_DEINIT : ~Copyable {
19
- @_hasStorage var value: Int { get set }
20
+ @_hasStorage var value: FakeInt { get set }
20
21
deinit
21
- init(value: Int )
22
+ init(value: FakeInt )
22
23
}
23
24
24
25
@_moveOnly struct MO {
25
- @_hasStorage var value: Int { get set }
26
+ @_hasStorage var value: FakeInt { get set }
26
27
}
27
28
28
29
struct NC : ~Copyable {
29
- @_hasStorage var value: Int { get set }
30
+ @_hasStorage var value: FakeInt { get set }
30
31
}
31
32
32
33
// CHECK: begin running test 1 of 4 on motest1: is-sil-trivial with: @instruction[2]
33
- // CHECK: %2 = struct $MO_DEINIT (%1 : $Int )
34
+ // CHECK: %2 = struct $MO_DEINIT (%1 : $FakeInt )
34
35
// CHECK: is not trivial
35
36
// CHECK: end running test 1 of 4 on motest1: is-sil-trivial with: @instruction[2]
36
37
// CHECK: begin running test 2 of 4 on motest1: get-ownership-kind with: @instruction[2]
37
- // CHECK: %2 = struct $MO_DEINIT (%1 : $Int )
38
- // CHECK: OwnershipKind: none
38
+ // CHECK: %2 = struct $MO_DEINIT (%1 : $FakeInt )
39
+ // CHECK: OwnershipKind: owned
39
40
// CHECK: end running test 2 of 4 on motest1: get-ownership-kind with: @instruction[2]
40
41
// CHECK: begin running test 3 of 4 on motest1: is-sil-trivial with: @instruction[4]
41
42
// CHECK: %4 = move_value [lexical] %2 : $MO_DEINIT
52
53
specify_test "get-ownership-kind @instruction[2]"
53
54
specify_test "is-sil-trivial @instruction[4]"
54
55
specify_test "get-ownership-kind @instruction[4]"
55
- %0 = integer_literal $Builtin.Int64 , 38
56
- %1 = struct $Int (%0 : $Builtin.Int64 )
57
- %2 = struct $MO_DEINIT (%1 : $Int )
56
+ %0 = integer_literal $Builtin.Int32 , 38
57
+ %1 = struct $FakeInt (%0 : $Builtin.Int32 )
58
+ %2 = struct $MO_DEINIT (%1 : $FakeInt )
58
59
debug_value %2 : $MO_DEINIT, let, name "b"
59
60
%4 = move_value [lexical] %2 : $MO_DEINIT
60
61
destroy_value %4 : $MO_DEINIT
63
64
}
64
65
65
66
// CHECK: begin running test 1 of 4 on motest2: is-sil-trivial with: @instruction[2]
66
- // CHECK: %2 = struct $MO (%1 : $Int )
67
+ // CHECK: %2 = struct $MO (%1 : $FakeInt )
67
68
// CHECK: is not trivial
68
69
// CHECK: end running test 1 of 4 on motest2: is-sil-trivial with: @instruction[2]
69
70
// CHECK: begin running test 2 of 4 on motest2: get-ownership-kind with: @instruction[2]
70
- // CHECK: %2 = struct $MO (%1 : $Int )
71
- // CHECK: OwnershipKind: none
71
+ // CHECK: %2 = struct $MO (%1 : $FakeInt )
72
+ // CHECK: OwnershipKind: owned
72
73
// CHECK: end running test 2 of 4 on motest2: get-ownership-kind with: @instruction[2]
73
74
// CHECK: begin running test 3 of 4 on motest2: is-sil-trivial with: @instruction[4]
74
75
// CHECK: %4 = move_value [lexical] %2 : $MO
85
86
specify_test "get-ownership-kind @instruction[2]"
86
87
specify_test "is-sil-trivial @instruction[4]"
87
88
specify_test "get-ownership-kind @instruction[4]"
88
- %0 = integer_literal $Builtin.Int64 , 38
89
- %1 = struct $Int (%0 : $Builtin.Int64 )
90
- %2 = struct $MO (%1 : $Int )
89
+ %0 = integer_literal $Builtin.Int32 , 38
90
+ %1 = struct $FakeInt (%0 : $Builtin.Int32 )
91
+ %2 = struct $MO (%1 : $FakeInt )
91
92
debug_value %2 : $MO, let, name "b"
92
93
%4 = move_value [lexical] %2 : $MO
93
94
destroy_value %4 : $MO
96
97
}
97
98
98
99
// CHECK: begin running test 1 of 4 on nctest1: is-sil-trivial with: @instruction[2]
99
- // CHECK: %2 = struct $NC_DEINIT (%1 : $Int )
100
+ // CHECK: %2 = struct $NC_DEINIT (%1 : $FakeInt )
100
101
// CHECK: is not trivial
101
102
// CHECK: end running test 1 of 4 on nctest1: is-sil-trivial with: @instruction[2]
102
103
// CHECK: begin running test 2 of 4 on nctest1: get-ownership-kind with: @instruction[2]
103
- // CHECK: %2 = struct $NC_DEINIT (%1 : $Int )
104
- // CHECK: OwnershipKind: none
104
+ // CHECK: %2 = struct $NC_DEINIT (%1 : $FakeInt )
105
+ // CHECK: OwnershipKind: owned
105
106
// CHECK: end running test 2 of 4 on nctest1: get-ownership-kind with: @instruction[2]
106
107
// CHECK: begin running test 3 of 4 on nctest1: is-sil-trivial with: @instruction[4]
107
108
// CHECK: %4 = move_value [lexical] %2 : $NC_DEINIT
119
120
specify_test "get-ownership-kind @instruction[2]"
120
121
specify_test "is-sil-trivial @instruction[4]"
121
122
specify_test "get-ownership-kind @instruction[4]"
122
- %0 = integer_literal $Builtin.Int64 , 38
123
- %1 = struct $Int (%0 : $Builtin.Int64 )
124
- %2 = struct $NC_DEINIT (%1 : $Int )
123
+ %0 = integer_literal $Builtin.Int32 , 38
124
+ %1 = struct $FakeInt (%0 : $Builtin.Int32 )
125
+ %2 = struct $NC_DEINIT (%1 : $FakeInt )
125
126
debug_value %2 : $NC_DEINIT, let, name "b"
126
127
%4 = move_value [lexical] %2 : $NC_DEINIT
127
128
destroy_value %4 : $NC_DEINIT
@@ -130,12 +131,12 @@ bb0:
130
131
}
131
132
132
133
// CHECK: begin running test 1 of 4 on nctest2: is-sil-trivial with: @instruction[2]
133
- // CHECK: %2 = struct $NC (%1 : $Int )
134
+ // CHECK: %2 = struct $NC (%1 : $FakeInt )
134
135
// CHECK: is not trivial
135
136
// CHECK: end running test 1 of 4 on nctest2: is-sil-trivial with: @instruction[2]
136
137
// CHECK: begin running test 2 of 4 on nctest2: get-ownership-kind with: @instruction[2]
137
- // CHECK: %2 = struct $NC (%1 : $Int )
138
- // CHECK: OwnershipKind: none
138
+ // CHECK: %2 = struct $NC (%1 : $FakeInt )
139
+ // CHECK: OwnershipKind: owned
139
140
// CHECK: end running test 2 of 4 on nctest2: get-ownership-kind with: @instruction[2]
140
141
// CHECK: begin running test 3 of 4 on nctest2: is-sil-trivial with: @instruction[4]
141
142
// CHECK: %4 = move_value [lexical] %2 : $NC
152
153
specify_test "get-ownership-kind @instruction[2]"
153
154
specify_test "is-sil-trivial @instruction[4]"
154
155
specify_test "get-ownership-kind @instruction[4]"
155
- %0 = integer_literal $Builtin.Int64 , 38
156
- %1 = struct $Int (%0 : $Builtin.Int64 )
157
- %2 = struct $NC (%1 : $Int )
156
+ %0 = integer_literal $Builtin.Int32 , 38
157
+ %1 = struct $FakeInt (%0 : $Builtin.Int32 )
158
+ %2 = struct $NC (%1 : $FakeInt )
158
159
debug_value %2 : $NC, let, name "b"
159
160
%4 = move_value [lexical] %2 : $NC
160
161
destroy_value %4 : $NC
0 commit comments