Skip to content

Commit aa61d95

Browse files
authored
[embedded] Allow disabling embedded stdlib, but still test compiler (swiftlang#73977)
While one can disable building the embedded stdlib, the tests for that feature were unconditionally added. If one wants to just build the compiler without any stdlib (except target), a bunch of embedded tests would have failed. Inject the value of `SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB` into the Lit test system as a feature `embedded_stdlib` and add `REQUIRES:` to a couple of tests outside the `embedded/` directory that seems to use the experimental feature. Make the tests in `embedded/` unsupported in the local Lit configuration file.
1 parent 135be13 commit aa61d95

File tree

6 files changed

+10
-0
lines changed

6 files changed

+10
-0
lines changed

test/DebugInfo/embedded.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
// REQUIRES: swift_in_compiler
77
// REQUIRES: executable_test
88
// REQUIRES: OS=macosx
9+
// REQUIRES: embedded_stdlib
910

1011
// CHECK: !DICompileUnit({{.*}}flags: "-enable-embedded-swift"

test/IDE/complete_embedded_linux.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// REQUIRES: asserts
22
// REQUIRES: swift_in_compiler
33
// REQUIRES: OS=linux-gnu
4+
// REQUIRES: embedded_stdlib
45
// RUN: %batch-code-completion -enable-experimental-feature Embedded
56

67
func test() {

test/IDE/complete_embedded_macos.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// REQUIRES: asserts
22
// REQUIRES: swift_in_compiler
33
// REQUIRES: OS=macosx
4+
// REQUIRES: embedded_stdlib
45
// RUN: %batch-code-completion -target %target-cpu-apple-macos14 -enable-experimental-feature Embedded
56

67
func test() {

test/SILOptimizer/devirt_deinits.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// REQUIRES: OS=macosx
1919

2020
// REQUIRES: swift_in_compiler
21+
// REQUIRES: embedded_stdlib
2122

2223
@inline(never)
2324
func log(_ s: StaticString) {

test/embedded/lit.local.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ if config.target_sdk_name == 'macosx':
1010
return (key, value)
1111

1212
config.substitutions = [do_fixup(a, b) for (a, b) in config.substitutions]
13+
14+
if 'embedded_stdlib' not in config.available_features:
15+
config.unsupported = True
16+

test/lit.site.cfg.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ if "@SWIFT_STDLIB_ENABLE_DEBUG_PRECONDITIONS_IN_RELEASE@" == "TRUE":
157157
config.available_features.add('swift_stdlib_debug_preconditions_in_release')
158158
if "@SWIFT_ENABLE_SYNCHRONIZATION@" == "TRUE":
159159
config.available_features.add('synchronization')
160+
if "@SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB@" == "TRUE":
161+
config.available_features.add('embedded_stdlib')
160162

161163
config.swift_freestanding_is_darwin = "@SWIFT_FREESTANDING_IS_DARWIN@" == "TRUE"
162164
config.swift_stdlib_use_relative_protocol_witness_tables = "@SWIFT_STDLIB_USE_RELATIVE_PROTOCOL_WITNESS_TABLES@" == "TRUE"

0 commit comments

Comments
 (0)