Skip to content

Commit c549028

Browse files
committed
test: sink -no-toolchain-stdlib-rpath into lit
This is a platform specific option and should be handled by lit patterns rather than encoded into the tests.
1 parent d5ab98d commit c549028

File tree

6 files changed

+38
-18
lines changed

6 files changed

+38
-18
lines changed

test/Macros/macro_expand.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: swift_swift_parser, executable_test
22

33
// RUN: %empty-directory(%t)
4-
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath -swift-version 5
4+
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift
55

66
// Diagnostics testing
77
// RUN: %target-typecheck-verify-swift -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -module-name MacroUser -DTEST_DIAGNOSTICS

test/Macros/macro_expand_other.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Expanding macros that are defined in terms of other macros.
22

33
// RUN: %empty-directory(%t)
4-
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -parse-as-library -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift -g -no-toolchain-stdlib-rpath
4+
// RUN: %host-build-swift -swift-version 5 -emit-library -o %t/%target-library-name(MacroDefinition) -parse-as-library -module-name=MacroDefinition %S/Inputs/syntax_macro_definitions.swift
55

66
// Diagnostics testing
77
// RUN: %target-typecheck-verify-swift -swift-version 5 -load-plugin-library %t/%target-library-name(MacroDefinition) -I %swift-host-lib-dir -module-name MacroUser -DTEST_DIAGNOSTICS

test/Macros/macro_plugin_broken.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
// RUN: %host-build-swift \
77
// RUN: -swift-version 5 -o %t/broken-plugin \
88
// RUN: -module-name=TestPlugin \
9-
// RUN: %t/broken_plugin.swift \
10-
// RUN: -g -no-toolchain-stdlib-rpath -swift-version 5
9+
// RUN: %t/broken_plugin.swift
1110

1211
// RUN: not %swift-target-frontend \
1312
// RUN: -typecheck \

test/Macros/macro_plugin_searchorder.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,23 @@
1818
// RUN: -emit-library -o %t/lib/plugins/%target-library-name(MacroDefinition) \
1919
// RUN: -module-name MacroDefinition \
2020
// RUN: -D PLUGIN_PATH \
21-
// RUN: %t/src/MacroDefinition.swift \
22-
// RUN: -g -no-toolchain-stdlib-rpath
21+
// RUN: %t/src/MacroDefinition.swift
2322

2423
//#-- For -load-plugin-library
2524
// RUN: %host-build-swift \
2625
// RUN: -swift-version 5 \
2726
// RUN: -emit-library -o %t/lib/tmp/%target-library-name(MacroDefinition) \
2827
// RUN: -module-name MacroDefinition \
2928
// RUN: -D LOAD_PLUGIN_LIBRARY \
30-
// RUN: %t/src/MacroDefinition.swift \
31-
// RUN: -g -no-toolchain-stdlib-rpath
29+
// RUN: %t/src/MacroDefinition.swift
3230

3331
//#-- For -external-plugin-path
3432
// RUN: %host-build-swift \
3533
// RUN: -swift-version 5 \
3634
// RUN: -emit-library -o %t/external/%target-library-name(MacroDefinition) \
3735
// RUN: -module-name MacroDefinition \
3836
// RUN: -D EXTERNAL_PLUGIN_PATH \
39-
// RUN: %t/src/MacroDefinition.swift \
40-
// RUN: -g -no-toolchain-stdlib-rpath
37+
// RUN: %t/src/MacroDefinition.swift
4138

4239
//#-- For -load-plugin-executable
4340
// RUN: %clang \

test/Macros/macro_swiftdeps.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
// RUN: -swift-version 5 \
1313
// RUN: -emit-library -o %t/plugin/%target-library-name(MacroDefinition) \
1414
// RUN: -module-name MacroDefinition \
15-
// RUN: %S/Inputs/syntax_macro_definitions.swift \
16-
// RUN: -g -no-toolchain-stdlib-rpath
15+
// RUN: %S/Inputs/syntax_macro_definitions.swift
1716

1817
//#-- Prepare the macro executable plugin.
1918
// RUN: %clang \

test/lit.cfg

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -541,23 +541,48 @@ if platform.system() == 'Darwin':
541541
"env SDKROOT=%s %r -toolchain-stdlib-rpath -Xlinker -rpath -Xlinker /usr/lib/swift %s %s %s"
542542
% (shell_quote(config.host_sdkroot), config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options))
543543
config.host_build_swift = (
544-
"%s -sdk %s -target %s -I %s -L %s"
544+
"%s -sdk %s -target %s -no-toolchain-stdlib-rpath -I %s -L %s"
545545
% (config.swiftc_driver, config.host_sdkroot, config.host_triple, config.swift_host_lib_dir, config.swift_host_lib_dir))
546546
else:
547547
config.swift_driver = (
548548
"%r %s %s %s"
549549
% (config.swift, mcp_opt, config.swift_test_options, config.swift_driver_test_options))
550+
550551
if kIsWindows:
551552
config.swift_driver += " -libc " + config.swift_stdlib_msvc_runtime
553+
552554
config.swiftc_driver = (
553-
"%r -toolchain-stdlib-rpath %s %s %s"
554-
% (config.swiftc, mcp_opt, config.swift_test_options, config.swift_driver_test_options))
555+
"%r -g %s %s %s %s" % (
556+
config.swiftc,
557+
'' if kIsWindows else '-no-toolchain-stdlib-rpath',
558+
mcp_opt,
559+
config.swift_test_options,
560+
config.swift_driver_test_options
561+
)
562+
)
563+
555564
# Parse the host triple.
556565
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
557566
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
558-
config.host_build_swift = (
559-
"%s -target %s -I %s -L %s -Xlinker -rpath -Xlinker %s"
560-
% (config.swiftc_driver, config.host_triple, config.swift_host_lib_dir, config.swift_host_lib_dir, toolchain_lib_dir))
567+
if kIsWindows:
568+
config.host_build_swift = (
569+
"%s -target %s -I %s -L %s" % (
570+
config.swiftc_driver,
571+
config.host_triple,
572+
config.swift_host_lib_dir,
573+
config.swift_host_lib_dir,
574+
)
575+
)
576+
else:
577+
config.host_build_swift = (
578+
"%s -target %s -g -no-toolchain-stdlib-rpath -I %s -L %s -Xlinker -rpath -Xlinker %s" % (
579+
config.swiftc_driver,
580+
config.host_triple,
581+
config.swift_host_lib_dir,
582+
config.swift_host_lib_dir,
583+
toolchain_lib_dir
584+
)
585+
)
561586

562587
config.substitutions.append( ('%llvm_obj_root', config.llvm_obj_root) )
563588
config.substitutions.append( ('%swift-bin-dir', config.swift_bin_dir) )

0 commit comments

Comments
 (0)