Skip to content

Commit f31dba3

Browse files
authored
Merge pull request #15811 from ravikandhadai/master
[Tests] Re-enable the tests for integer overflow diagnostics
2 parents a871aed + 6da6937 commit f31dba3

4 files changed

+467
-546
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

0 commit comments

Comments
 (0)