mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
`verifyUnknown()` and `verifyUnrelated()` would not remove the diagnostics after reporting their errors, leading to the same diagnostics then being emitted a second time. This removes them from the list after emitting them, just like `verifyFile()` does.
15 lines
1.1 KiB
Swift
15 lines
1.1 KiB
Swift
// Tests that `-verify` mode outputs diagnostics from a failing C module
|
|
// compilation.
|
|
// This needs to be a separate test from verify.swift because compilation will
|
|
// terminate after the failing import statement.
|
|
|
|
// RUN: not %target-typecheck-verify-swift -I %S/Inputs/broken-c-module 2>&1 | %FileCheck %s --implicit-check-not error: --implicit-check-not note: --implicit-check-not warning:
|
|
|
|
// CHECK: <unknown>:0: error: fatal error encountered while in -verify mode
|
|
// CHECK: [[@LINE+5]]:8: error: unexpected error produced: could not build
|
|
// CHECK: error: unexpected note produced: in file included from <module-includes>:1:
|
|
// CHECK: note: file '<module-includes>' is not parsed for 'expected' statements. Use '-verify-additional-file <module-includes>' to enable, or '-verify-ignore-unrelated' to ignore diagnostics in this file
|
|
// CHECK: error: unexpected error produced: expected function body after function declarator
|
|
// CHECK: note: file '{{.*}}broken_c.h' is not parsed for 'expected' statements. Use '-verify-additional-file {{.*}}broken_c.h' to enable, or '-verify-ignore-unrelated' to ignore diagnostics in this file
|
|
import BrokenCModule
|