mirror of
https://github.com/apple/swift.git
synced 2026-10-22 19:15:50 +02:00
The opaque values test coverage I initially added will emit to stdout, which is noisy for people's logs if the test is failing for some other reason.
19 lines
498 B
Swift
19 lines
498 B
Swift
// RUN: %target-swift-emit-silgen-ossa -o /dev/null -enable-sil-opaque-values %s
|
|
// RUN: %target-swift-emit-silgen -verify %s
|
|
|
|
struct NC: ~Copyable {}
|
|
|
|
enum NoncopyableEnum: ~Copyable {
|
|
case copyable(Int)
|
|
case noncopyable(NC)
|
|
}
|
|
|
|
func test(foo: consuming NoncopyableEnum) {
|
|
switch foo {
|
|
case let x: // expected-warning{{'x' was never used}}
|
|
break
|
|
case .copyable(let x): // expected-warning{{already handled by previous patterns}} expected-warning{{'x' was never used}}
|
|
break
|
|
}
|
|
}
|