@@ -16,7 +16,7 @@ let S = "String1"
16
16
let VOLUME1 = I * J
17
17
let VOLUME2 = J * 2
18
18
let VOLUME3 = I + 10
19
-
19
+ let maxSize = Int . max >> 1
20
20
21
21
22
22
struct IntWrapper1 {
@@ -74,6 +74,8 @@ struct B {
74
74
75
75
static let VOLUME3 = I + 10
76
76
77
+ static let maxSize = Int . max >> 1
78
+
77
79
static var PROP1 : Double {
78
80
return PI
79
81
}
@@ -110,6 +112,8 @@ class C {
110
112
static let VOLUME2 = J * 2
111
113
112
114
static let VOLUME3 = I + 10
115
+
116
+ static let maxSize = Int . max >> 1
113
117
114
118
static var PROP1 : Double {
115
119
return PI
@@ -172,7 +176,7 @@ public func test_let_double_complex() -> Double {
172
176
// CHECK: return
173
177
@inline ( never)
174
178
public func test_let_int_complex( ) -> Int {
175
- return I + J + VOLUME1 + VOLUME2 + VOLUME3 + PROP2
179
+ return I + J + VOLUME1 + VOLUME2 + VOLUME3 + PROP2 + maxSize
176
180
}
177
181
178
182
// CHECK-LABEL: sil [noinline] @$s25globalopt_let_propagation019test_static_struct_B7_doubleSdyF
@@ -218,10 +222,9 @@ public func test_static_struct_let_double_complex() -> Double {
218
222
// CHECK: return
219
223
@inline ( never)
220
224
public func test_static_struct_let_int_complex( ) -> Int {
221
- return B . I + B. J + B. VOLUME1 + B. VOLUME2 + B. VOLUME3 + B. PROP2
225
+ return B . I + B. J + B. VOLUME1 + B. VOLUME2 + B. VOLUME3 + B. maxSize + B . PROP2
222
226
}
223
227
224
-
225
228
// CHECK-LABEL: sil [noinline] @$s25globalopt_let_propagation018test_static_class_B7_doubleSdyF
226
229
// CHECK: bb0:
227
230
// CHECK-NEXT: float_literal
@@ -265,7 +268,7 @@ public func test_static_class_let_double_complex() -> Double {
265
268
// CHECK: return
266
269
@inline ( never)
267
270
public func test_static_class_let_int_complex( ) -> Int {
268
- return C . I + C. J + C. VOLUME1 + C. VOLUME2 + C. VOLUME3 + C. PROP2
271
+ return C . I + C. J + C. VOLUME1 + C. VOLUME2 + C. VOLUME3 + C. maxSize + C . PROP2
269
272
}
270
273
271
274
// CHECK-LABEL: sil [noinline] @$s25globalopt_let_propagation15test_var_doubleSdyF
0 commit comments