mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
FrontendTool sets up diagnostic infrastructure early and suppresses stdout diagnostics if frontend-parseable-output is enabled. It then calls `CompilerInstance.setup` which may fail - if it fails, we exit early. But that means we have not gotten a chance to emit parseable-output. This change moves emission of the `began` parseable message to before `CompilerInstance.setup`, and ensures that a corresponding `finished` message is emitted if the setup fails. Resolves rdar://93187783
10 lines
529 B
Swift
10 lines
529 B
Swift
// RUN: not %target-swift-frontend(mock-sdk: -sdk %/S/../ModuleInterface/Inputs/BadStdlib.sdk -module-cache-path %/t/module-cache -resource-dir %/S/../ModuleInterface/Inputs/BadStdlib.sdk) -primary-file %s -o %t.out -emit-module -emit-module-path %t.swiftmodule -module-name parseable_output_early -frontend-parseable-output 2>&1 | %FileCheck %s
|
|
|
|
// CHECK: {{[1-9][0-9]*}}
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "kind": "began",
|
|
// CHECK-NEXT: "name": "compile",
|
|
|
|
// CHECK: "kind": "finished",
|
|
// CHECK-NEXT: "name": "compile",
|