Files
swift-mirror/test/SILOptimizer/constant_propagation_diagnostics.swift
Allan Shortlidge 0e5cfa6259 NFC: Remove duplicated RUN lines from many SILOptimizer tests.
A previous PR (https://github.com/apple/swift/pull/32407) that mass-modified
tests left some duplicate `RUN:` lines behind.
2023-08-08 11:19:52 -07:00

14 lines
667 B
Swift

// RUN: %target-swift-frontend -emit-sil -sdk %S/../SILGen/Inputs %s -o /dev/null -verify
// <rdar://problem/18213320> enum with raw values that are too big are not diagnosed
enum EnumWithTooLargeElements : UInt8 {
case negativeOne = -1 // expected-error 2 {{negative integer '-1' overflows when stored into unsigned type 'UInt8'}}
case one = 1
case two = 2
case three
case twoHundredFiftyFour = 254
case twoHundredFiftyFive
case twoHundredFiftySix // expected-error 2 {{integer literal '256' overflows when stored into 'UInt8'}}
case tooFarByFar = 123456 // expected-error 2 {{integer literal '123456' overflows when stored into 'UInt8'}}
}