-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[test] Update tests for parity with the new driver #76640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is no longer a behavior we have in the new driver (swiftlang/swift-driver#733).
This is only testing legacy driver behaviour. In the new driver, only primary outputs have their outputs deduced from the module name.
The new driver builds a PCH by default, which the old driver didn't do. These tests don't expect a PCH, so avoid building it.
Add `-wmo` to the invocation to ensure we don't end up doing merge-modules, which makes the test consistent across both the old and new driver.
This crashes the new driver (swiftlang/swift-driver#1570).
A couple of tests are expecting merge-modules behaviour, add `-no-emit-module-separately` in those cases to ensure that merge modules is used in both the old and new driver.
The new driver forms additional jobs for the auxiliary outputs here, whereas the old driver would only do a single job. This shouldn't really matter in practice though since we make an effort not to include auxiliary outputs in indexing invocations.
e0366e9 to
2a5dba6
Compare
CMO is enabled by default in the new driver, add `-enable-default-cmo` in a couple of places to make the behavior consistent across both the old and new driver.
The behavior of these tests varies depending on whether the new or old driver is being used, force the old driver for now.
2a5dba6 to
8e0407b
Compare
|
@swift-ci please test |
|
SymbolGraphGen test update looks good. How do you force running tests with the new driver? I'm interested to know so i can double-check during the transition period. |
|
@QuietMisdreavus You can force the new driver by setting |
| // RUN: %target-build-swift -O -wmo -Xfrontend -enable-default-cmo -parse-as-library -emit-tbd -emit-tbd-path %t/ModuleTBD.tbd -emit-module -emit-module-path=%t/ModuleTBD.swiftmodule -module-name=ModuleTBD -package-name Pkg -I%t -I%S/Inputs/cross-module %S/Inputs/cross-module/default-module.swift -c -o %t/moduletbd.o -Xfrontend -tbd-install_name -Xfrontend module | ||
|
|
||
| // RUN: %target-build-swift -O -wmo -module-name=Main -package-name Pkg -I%t -I%S/Inputs/cross-module %s -emit-sil | %FileCheck %s | ||
| // RUN: %target-build-swift -Xfrontend -enable-default-cmo -O -wmo -module-name=Main -package-name Pkg -I%t -I%S/Inputs/cross-module %s -emit-sil | %FileCheck %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed? Default CMO should be enabled by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test suite currently uses the old driver, where it's disabled by default
|
@swift-ci please test Linux |
Update tests such that they run with both the old and new driver in preparation for switching over to the new driver.