Skip to content

Commit 6c4ae5d

Browse files
authored
Merge pull request swiftlang#68315 from compnerd/rpath-v1
test: sink `-no-toolchain-stdlib-rpath` into lit
2 parents cfd070f + d0bf84a commit 6c4ae5d

6 files changed

+25
-17
lines changed

test/Macros/macro_expand.swift

+1-1
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

+1-1
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

+1-2
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

+3-6
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

+1-2
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

+18-5
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ 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 = (
@@ -550,14 +550,27 @@ else:
550550
if kIsWindows:
551551
config.swift_driver += " -libc " + config.swift_stdlib_msvc_runtime
552552
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))
553+
"%r %s %s %s %s" % (
554+
config.swiftc,
555+
'' if kIsWindows else '-toolchain-stdlib-rpath',
556+
mcp_opt,
557+
config.swift_test_options,
558+
config.swift_driver_test_options
559+
)
560+
)
555561
# Parse the host triple.
556562
(host_cpu, host_vendor, host_os, host_vers) = re.match('([^-]+)-([^-]+)-([^0-9-]+)(.*)', config.host_triple).groups()
557563
toolchain_lib_dir = make_path(config.swift_lib_dir, 'swift', host_os)
558564
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))
565+
"%s -target %s -g %s -I %s -L %s %s" % (
566+
config.swiftc_driver,
567+
config.host_triple,
568+
'' if kIsWindows else '-no-toolchain-stdlib-rpath',
569+
config.swift_host_lib_dir,
570+
config.swift_host_lib_dir,
571+
'' if kIsWindows else '-Xlinker -rpath -Xlinker {}'.format(toolchain_lib_dir)
572+
)
573+
)
561574

562575
config.substitutions.append( ('%llvm_obj_root', config.llvm_obj_root) )
563576
config.substitutions.append( ('%swift-bin-dir', config.swift_bin_dir) )

0 commit comments

Comments
 (0)