mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sadly, in Windows, the last invocation of the test, which mixes `emit-loaded-module-trace` and the two frontend invocations, fails with the compiler crashing. Instead of this being reported correctly thru lit, it crashes the lit driver and the test is not even marked as failed. When running several tests in parallel, it crashes one of the workers and outputs a cryptic "Error 87". Sadly, because of how the test seems to break, and how Windows seems to fail, XFAILing the test is not enough, and it has to be skipped completely in Windows and have to be mark as unsupported instead. Hopefully this will unstuck the Windows CI machines.
69 lines
4.5 KiB
Swift
69 lines
4.5 KiB
Swift
// UNSUPPORTED: -windows-msvc
|
|
|
|
// 1) If there is no swiftmodule, use the swiftinterface
|
|
//
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift -swift-version 5 -enable-library-evolution -module-name Module %S/Inputs/loaded_module_trace_empty.swift -emit-module-interface-path %t/Module.swiftinterface
|
|
// RUN: %target-build-swift -swift-version 5 -I %t -module-name Module2 %S/Inputs/loaded_module_trace_imports_module.swift -emit-module -o %t/Module2.swiftmodule
|
|
// RUN: %target-build-swift -I %t %s -emit-loaded-module-trace -o %t/loaded_module_trace_swiftinterface
|
|
// RUN: %FileCheck -check-prefix=CHECK %s < %t/loaded_module_trace_swiftinterface.trace.json
|
|
//
|
|
// CHECK: {
|
|
// CHECK: "version":2
|
|
// CHECK: "name":"loaded_module_trace_swiftinterface"
|
|
// CHECK: "arch":"{{[^"]*}}"
|
|
// CHECK: "swiftmodules":[
|
|
// CHECK-DAG: "{{[^"]*\\[/\\]}}Module2.swiftmodule"
|
|
// CHECK-DAG: "{{[^"]*\\[/\\]}}Swift.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
|
|
// CHECK-DAG: "{{[^"]*\\[/\\]}}SwiftOnoneSupport.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
|
|
// CHECK-DAG: "{{[^"]*\\[/\\]}}Module.swiftinterface"
|
|
// CHECK-NOT: Module.swiftmodule
|
|
// CHECK: ]
|
|
// CHECK: "swiftmodulesDetailedInfo":[
|
|
// CHECK-DAG: {"name":"Module2","path":"{{[^"]*\\[/\\]}}Module2.swiftmodule","isImportedDirectly":true,"supportsLibraryEvolution":false}
|
|
// CHECK-DAG: {"name":"Swift","path":"{{[^"]*\\[/\\]}}Swift.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}","isImportedDirectly":true,"supportsLibraryEvolution":true}
|
|
// CHECK-DAG: {"name":"SwiftOnoneSupport","path":"{{[^"]*\\[/\\]}}SwiftOnoneSupport.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}","isImportedDirectly":true,"supportsLibraryEvolution":true}
|
|
// CHECK-DAG: {"name":"Module","path":"{{[^"]*\\[/\\]}}Module.swiftinterface","isImportedDirectly":false,"supportsLibraryEvolution":true}
|
|
// CHECK: ]
|
|
// CHECK: }
|
|
|
|
|
|
// 2) If there is a swiftmodule next to the swiftinterface, use that instead.
|
|
//
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift -swift-version 5 -enable-library-evolution -module-name Module %S/Inputs/loaded_module_trace_empty.swift -emit-module-interface-path %t/Module.swiftinterface -emit-module -o %t/Module.swiftmodule
|
|
// RUN: %target-swift-frontend -swift-version 5 -I %t -module-name Module2 %S/Inputs/loaded_module_trace_imports_module.swift -emit-module -o %t/Module2.swiftmodule
|
|
// RUN: %target-build-swift -I %t %s -emit-loaded-module-trace -o %t/loaded_module_trace_swiftinterface
|
|
// RUN: %FileCheck -check-prefix=ADJMODULE %s < %t/loaded_module_trace_swiftinterface.trace.json
|
|
//
|
|
// ADJMODULE: Module.swiftmodule
|
|
// ADJMODULE-NOT: Module.swiftinterface
|
|
|
|
|
|
// 3) If there is a swiftmodule in the (non-prebuilt) module cache path pointing to the swiftinterface, use the swiftinterface.
|
|
//
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: mkdir %t/MCP
|
|
// RUN: %target-build-swift -swift-version 5 -enable-library-evolution -module-cache-path %t/MCP -module-name Module %S/Inputs/loaded_module_trace_empty.swift -emit-module-interface-path %t/Module.swiftinterface -emit-module -o %t/MCP/Module.swiftmodule
|
|
// RUN: %target-swift-frontend -swift-version 5 -I %t -module-cache-path %t/MCP -module-name Module2 %S/Inputs/loaded_module_trace_imports_module.swift -emit-module -o %t/Module2.swiftmodule
|
|
// RUN: %target-build-swift -I %t -module-cache-path %t/MCP %s -emit-loaded-module-trace -o %t/loaded_module_trace_swiftinterface
|
|
// RUN: %FileCheck -check-prefix=CACHEDMODULE %s < %t/loaded_module_trace_swiftinterface.trace.json
|
|
//
|
|
// CACHEDMODULE: Module.swiftinterface
|
|
// CACHEDMODULE-NOT: Module.swiftmodule
|
|
|
|
|
|
// 4) If there is a swiftmodule in the prebuilt module cache path pointing to the swiftinterface, use the swiftinterface.
|
|
//
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: mkdir %t/MCP %t/PB %t/Main
|
|
// RUN: %target-swift-frontend -swift-version 5 -enable-library-evolution -prebuilt-module-cache-path %t/PB -module-cache-path %/MCP -module-name Module %S/Inputs/loaded_module_trace_empty.swift -emit-module -o %t/PB/Module.swiftmodule -emit-module-interface-path %t/Main/Module.swiftinterface
|
|
// RUN: %target-swift-frontend -swift-version 5 -I %t/Main -prebuilt-module-cache-path %t/PB -module-cache-path %t/MCP -module-name Module2 %S/Inputs/loaded_module_trace_imports_module.swift -emit-module -o %t/Main/Module2.swiftmodule
|
|
// RUN: %target-build-swift -I %t/Main -module-cache-path %t/MCP %s -emit-loaded-module-trace -o %t/loaded_module_trace_swiftinterface
|
|
// RUN: %FileCheck -check-prefix=PREBUILTMODULE %s < %t/loaded_module_trace_swiftinterface.trace.json
|
|
//
|
|
// PREBUILTMODULE: Module.swiftinterface
|
|
// PREBUILTMODULE-NOT: Module.swiftmodule
|
|
|
|
import Module2
|