swift-testing
swift-testing copied to clipboard
[WIP] Enable support for the `@_section` experimental attribute.
This PR enables support for @_used and @_section to allow embedding test data directly into its own section in a binary. This means we don't have to look up synthesized test types at runtime.
Limitations:
- Test clients must enable support for the experimental
"SymbolLinkageMarkers"feature. - The
@_sectionattribute currently doesn't support application to constants of function type, thinking they are non-constant. - We will need to make a change to the Swift runtime on Linux/Windows to add the new section to
MetadataSections(or alternatively, the experimental feature needs to provide a different way to discover sections at runtime.) See https://github.com/apple/swift/pull/71509.
:warning: Do not merge: this is a proof-of-concept and work-in-progress.
Checklist:
- [x] Code and documentation should follow the style of the Style Guide.
- [x] If public symbols are renamed or modified, DocC references should be updated.
@swift-ci please test
@swift-ci please test
@compnerd says the Windows section needs the suffix "$B".
@swift-ci please test
Linux failure is expected right now; the new swift5_tests section needs a newer toolchain.
Looks like Windows has a compile-time complaint about the constness of C function pointers.
@swift-ci please test
@swift-ci please test