11// RUN: %target-sil-opt -test-runner %s -o /dev/null 2>&1 | %FileCheck %s
22
3- // rdar://124466060
4- // UNSUPPORTED: CPU=armv7k
5-
63sil_stage raw
74
85import Builtin
96import Swift
107import SwiftShims
118
9+ struct FakeInt {
10+ var i: Builtin.Int32
11+ }
12+
1213@_moveOnly struct MO_DEINIT {
13- @_hasStorage var value: Int { get set }
14+ @_hasStorage var value: FakeInt { get set }
1415 deinit
15- init(value: Int )
16+ init(value: FakeInt )
1617}
1718
1819struct NC_DEINIT : ~Copyable {
19- @_hasStorage var value: Int { get set }
20+ @_hasStorage var value: FakeInt { get set }
2021 deinit
21- init(value: Int )
22+ init(value: FakeInt )
2223}
2324
2425@_moveOnly struct MO {
25- @_hasStorage var value: Int { get set }
26+ @_hasStorage var value: FakeInt { get set }
2627}
2728
2829struct NC : ~Copyable {
29- @_hasStorage var value: Int { get set }
30+ @_hasStorage var value: FakeInt { get set }
3031}
3132
3233// 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 )
3435// CHECK: is not trivial
3536// CHECK: end running test 1 of 4 on motest1: is-sil-trivial with: @instruction[2]
3637// 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
3940// CHECK: end running test 2 of 4 on motest1: get-ownership-kind with: @instruction[2]
4041// CHECK: begin running test 3 of 4 on motest1: is-sil-trivial with: @instruction[4]
4142// CHECK: %4 = move_value [lexical] %2 : $MO_DEINIT
5253 specify_test "get-ownership-kind @instruction[2]"
5354 specify_test "is-sil-trivial @instruction[4]"
5455 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 )
5859 debug_value %2 : $MO_DEINIT, let, name "b"
5960 %4 = move_value [lexical] %2 : $MO_DEINIT
6061 destroy_value %4 : $MO_DEINIT
6364}
6465
6566// 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 )
6768// CHECK: is not trivial
6869// CHECK: end running test 1 of 4 on motest2: is-sil-trivial with: @instruction[2]
6970// 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
7273// CHECK: end running test 2 of 4 on motest2: get-ownership-kind with: @instruction[2]
7374// CHECK: begin running test 3 of 4 on motest2: is-sil-trivial with: @instruction[4]
7475// CHECK: %4 = move_value [lexical] %2 : $MO
8586 specify_test "get-ownership-kind @instruction[2]"
8687 specify_test "is-sil-trivial @instruction[4]"
8788 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 )
9192 debug_value %2 : $MO, let, name "b"
9293 %4 = move_value [lexical] %2 : $MO
9394 destroy_value %4 : $MO
9697}
9798
9899// 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 )
100101// CHECK: is not trivial
101102// CHECK: end running test 1 of 4 on nctest1: is-sil-trivial with: @instruction[2]
102103// 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
105106// CHECK: end running test 2 of 4 on nctest1: get-ownership-kind with: @instruction[2]
106107// CHECK: begin running test 3 of 4 on nctest1: is-sil-trivial with: @instruction[4]
107108// CHECK: %4 = move_value [lexical] %2 : $NC_DEINIT
119120 specify_test "get-ownership-kind @instruction[2]"
120121 specify_test "is-sil-trivial @instruction[4]"
121122 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 )
125126 debug_value %2 : $NC_DEINIT, let, name "b"
126127 %4 = move_value [lexical] %2 : $NC_DEINIT
127128 destroy_value %4 : $NC_DEINIT
@@ -130,12 +131,12 @@ bb0:
130131}
131132
132133// 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 )
134135// CHECK: is not trivial
135136// CHECK: end running test 1 of 4 on nctest2: is-sil-trivial with: @instruction[2]
136137// 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
139140// CHECK: end running test 2 of 4 on nctest2: get-ownership-kind with: @instruction[2]
140141// CHECK: begin running test 3 of 4 on nctest2: is-sil-trivial with: @instruction[4]
141142// CHECK: %4 = move_value [lexical] %2 : $NC
152153 specify_test "get-ownership-kind @instruction[2]"
153154 specify_test "is-sil-trivial @instruction[4]"
154155 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 )
158159 debug_value %2 : $NC, let, name "b"
159160 %4 = move_value [lexical] %2 : $NC
160161 destroy_value %4 : $NC
0 commit comments