Files
swift-mirror/test/diagnostics/sil-opt-verifier.sil
Owen Voorhees 465bab002f [DiagnosticVerifier] Make Diagnostic Verifier a DiagnosticConsumer subclass
Update DiagnosticVerifier to respect color flags

Improve DiagnosticVerifier test coverage

verifier updates to support new llvm stable branch
2020-03-28 12:29:53 -07:00

15 lines
578 B
Plaintext

// RUN: not %target-sil-opt -enable-sil-verify-all %s -definite-init -verify 2>&1 | %FileCheck %s
import Builtin
import Swift
// main
sil [ossa] @main : $@convention(c) (Int32, UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>) -> Int32 {
bb0(%0 : $Int32, %1 : $UnsafeMutablePointer<Optional<UnsafeMutablePointer<Int8>>>):
%2 = integer_literal $Builtin.Int32, 0
%3 = struct $Int32 (%2 : $Builtin.Int32)
return %4 : $Int32 // expected-error {{use of undefined value '%5'}}
// CHECK-NOT: error: use of undefined value '%4'
// CHECK: incorrect message found
}