Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions swift/internal/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ def _all_action_configs(
swift_toolchain_config.action_config(
actions = [
swift_action_names.COMPILE,
swift_action_names.DERIVE_FILES,
swift_action_names.PRECOMPILE_C_MODULE,
],
configurators = [swift_toolchain_config.add_arg("-embed-bitcode")],
Expand All @@ -328,7 +327,6 @@ def _all_action_configs(
swift_toolchain_config.action_config(
actions = [
swift_action_names.COMPILE,
swift_action_names.DERIVE_FILES,
swift_action_names.PRECOMPILE_C_MODULE,
],
configurators = [
Expand Down
8 changes: 8 additions & 0 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ bzl_library(
"//test/rules:starlark_tests_bzls",
],
)

# TODO: Remove once https://github.com/bazelbuild/bazel/pull/10945 lands
config_setting(
name = "linux",
constraint_values = [
"@bazel_tools//platforms:linux",
],
)
62 changes: 62 additions & 0 deletions test/split_derived_files_tests.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ split_swiftmodule_indexing_test = make_action_command_line_test_rule(
],
},
)
split_swiftmodule_bitcode_test = make_action_command_line_test_rule(
config_settings = {
"//command_line_option:apple_bitcode": "embedded",
"//command_line_option:features": [
"swift.split_derived_files_generation",
],
},
)
split_swiftmodule_bitcode_markers_test = make_action_command_line_test_rule(
config_settings = {
"//command_line_option:apple_bitcode": "embedded_markers",
"//command_line_option:features": [
"swift.split_derived_files_generation",
],
},
)

def split_derived_files_test_suite(name = "split_derived_files"):
"""Test suite for split derived files options.
Expand Down Expand Up @@ -256,6 +272,52 @@ def split_derived_files_test_suite(name = "split_derived_files"):
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
)

split_swiftmodule_bitcode_test(
name = "{}_bitcode_compile".format(name),
expected_argv = select({
"//test:linux": [],
"//conditions:default": [
"-embed-bitcode",
],
}),
mnemonic = "SwiftCompile",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
)

split_swiftmodule_bitcode_test(
name = "{}_bitcode_derive_files".format(name),
not_expected_argv = [
"-embed-bitcode",
],
mnemonic = "SwiftDeriveFiles",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
)

split_swiftmodule_bitcode_markers_test(
name = "{}_bitcode_markers_compile".format(name),
expected_argv = select({
"//test:linux": [],
"//conditions:default": [
"-embed-bitcode-marker",
],
}),
mnemonic = "SwiftCompile",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
)

split_swiftmodule_bitcode_markers_test(
name = "{}_bitcode_markers_derive_files".format(name),
not_expected_argv = [
"-embed-bitcode-marker",
],
mnemonic = "SwiftDeriveFiles",
tags = [name],
target_under_test = "@build_bazel_rules_swift//test/fixtures/debug_settings:simple",
)

native.test_suite(
name = name,
tags = [name],
Expand Down