Skip to content

Commit 6da6937

Browse files
committed
[Tests] Fix Radar problem <rdar:/19508336>
"Extend test/SILPasses/diagnostic_constant_propagation.swift" by removing tests from the file that referred to `Int` and `UInt` types. These tests are dependent on the word length of the architecture and are covered by the tests in the files `diagnostic_constant_propagation_int_archXX.swift`. Also, this commit corrects erroneous references to a radar problem in the test suties: `diagnostic_constant_propagation_int_archXX.swift`
1 parent 82f0bb1 commit 6da6937

File tree

3 files changed

+4
-21
lines changed

3 files changed

+4
-21
lines changed

test/SILOptimizer/diagnostic_constant_propagation.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
// RUN: %target-swift-frontend -emit-sil -primary-file %s -o /dev/null -verify
22
//
3-
// REQUIRES: PTRSIZE=64
4-
//
53
// These are tests for diagnostics produced by constant propagation pass.
64
// Due to the change in the implementation of Integer initializers some of the
75
// tests here that must fail don't currently. Such tests have comments
@@ -10,9 +8,6 @@
108
// References: <rdar://problem/29937936>, <rdar://problem/29939484>,
119
// <https://bugs.swift.org/browse/SR-5964>, <rdar://problem/39120081>
1210

13-
// FIXME: <rdar://problem/19508336> Extend
14-
// test/SILOptimizer/diagnostic_constant_propagation.swift to 32-bit platforms
15-
1611
func testArithmeticOverflow() {
1712
let xu8 : UInt8 = 250
1813
let yu8 : UInt8 = 250
@@ -258,12 +253,6 @@ func testDivision() {
258253
}
259254

260255
func testPostIncOverflow() {
261-
var s_max = Int.max
262-
s_max += 1 // expected-error {{arithmetic operation '9223372036854775807 + 1' (on type 'Int') results in an overflow}}
263-
264-
var u_max = UInt.max
265-
u_max += 1 // expected-error {{arithmetic operation '18446744073709551615 + 1' (on type 'UInt') results in an overflow}}
266-
267256
var s8_max = Int8.max
268257
s8_max += 1 // expected-error {{arithmetic operation '127 + 1' (on type 'Int8') results in an overflow}}
269258

@@ -290,12 +279,6 @@ func testPostIncOverflow() {
290279
}
291280

292281
func testPostDecOverflow() {
293-
var s_min = Int.min
294-
s_min -= 1 // expected-error {{arithmetic operation '-9223372036854775808 - 1' (on type 'Int') results in an overflow}}
295-
296-
var u_min = UInt.min
297-
u_min -= 1 // expected-error {{arithmetic operation '0 - 1' (on type 'UInt') results in an overflow}}
298-
299282
var s8_min = Int8.min
300283
s8_min -= 1 // expected-error {{arithmetic operation '-128 - 1' (on type 'Int8') results in an overflow}}
301284

test/SILOptimizer/diagnostic_constant_propagation_int_arch32.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
// FIXME: <rdar://problem/29937936> False negatives when using integer initializers
1313
//
14-
// FIXME: <rdar://problem/19623142> A false negative that happens only in REPL
14+
// FIXME: <rdar://problem/39193272> A false negative that happens only in REPL
1515

1616
func testArithmeticOverflow_Int_32bit() {
1717
do {
@@ -28,7 +28,7 @@ func testArithmeticOverflow_Int_32bit() {
2828
var _: Int = -(-0x7fff_ffff) // OK
2929
var _: Int = -(-0x8000_0000) // expected-error {{arithmetic operation '0 - -2147483648' (on signed 32-bit integer type) results in an overflow}}
3030
// FIXME: Missing diagnostic in REPL:
31-
// <rdar://problem/19623142> Overflow in arithmetic negation is not detected
31+
// <rdar://problem/39193272> Overflow in arithmetic negation is not detected
3232
// at compile time when running in REPL
3333
}
3434

test/SILOptimizer/diagnostic_constant_propagation_int_arch64.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//
1212
// FIXME: <rdar://problem/29937936> False negatives when using integer initializers
1313
//
14-
// FIXME: <rdar://problem/19623142> A false negative that happens only in REPL
14+
// FIXME: <rdar://problem/39193272> A false negative that happens only in REPL
1515

1616
func testArithmeticOverflow_Int_64bit() {
1717
do {
@@ -28,7 +28,7 @@ func testArithmeticOverflow_Int_64bit() {
2828
var _: Int = -(-0x7fff_ffff_ffff_ffff) // OK
2929
var _: Int = -(-0x8000_0000_0000_0000) // expected-error {{arithmetic operation '0 - -9223372036854775808' (on signed 64-bit integer type) results in an overflow}}
3030
// FIXME: Missing diagnostic in REPL:
31-
// <rdar://problem/19623142> Overflow in arithmetic negation is not detected
31+
// <rdar://problem/39193272> Overflow in arithmetic negation is not detected
3232
// at compile time when running in REPL
3333
}
3434

0 commit comments

Comments
 (0)