Files
swift-mirror/test/SILOptimizer/diagnostic_constant_propagation-swift4.swift
Michael Gottesman f10b45b540 [ownership] Add an extra run of -Onone tests with diagnostics with -enable-ownership-stripping-after-serialization enabled.
Right now the stdlib/overlays can compile against -Onone tests with or without
-enable-ownership-stripping-after-serialization. This will help me to prevent
other work going on from breaking these properties.
2019-10-26 15:12:14 -07:00

10 lines
515 B
Swift

// RUN: %target-swift-frontend -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify
// RUN: %target-swift-frontend -swift-version 4 -emit-sil -primary-file %s -o /dev/null -verify -enable-ownership-stripping-after-serialization
//
// These are tests for diagnostics produced by constant propagation pass.
// These are specific to Swift 4.
func testArithmeticOverflowSwift4() {
var _ = Int8(126) + (1 + 1) // expected-error {{arithmetic operation '126 + 2' (on type 'Int8') results in an overflow}}
}