Skip to content

Commit 23d02b7

Browse files
committed
Fix LTO test to use just use libLTO.dylib
This is necessary until the Xcode toolchain's libLTO.dylib supports opaque pointers
1 parent f08f299 commit 23d02b7

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

test/IRGen/hermetic-seal-exec.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: %empty-directory(%t)
44

55
// (1) Build library swiftmodule
6-
// RUN: %target-build-swift %s -DLIBRARY -module-name Library -experimental-hermetic-seal-at-link -lto=llvm-full %lto_flags \
6+
// RUN: %use_just_built_liblto %target-build-swift %s -DLIBRARY -module-name Library -experimental-hermetic-seal-at-link -lto=llvm-full %lto_flags \
77
// RUN: -Xfrontend -disable-reflection-metadata -Xfrontend -disable-reflection-names -Xfrontend -disable-objc-interop \
88
// RUN: -emit-library -static -o %t/libLibrary.a \
99
// RUN: -emit-module -emit-module-path %t/Library.swiftmodule
@@ -12,7 +12,7 @@
1212
// RUN: %llvm-nm %t/libLibrary.a | %FileCheck %s --check-prefix CHECK-NM-LIB
1313

1414
// (3) Build client
15-
// RUN: %target-build-swift %s -DCLIENT -parse-as-library -module-name Main -experimental-hermetic-seal-at-link -lto=llvm-full %lto_flags \
15+
// RUN: %use_just_built_liblto %target-build-swift %s -DCLIENT -parse-as-library -module-name Main -experimental-hermetic-seal-at-link -lto=llvm-full %lto_flags \
1616
// RUN: -Xfrontend -disable-reflection-metadata -Xfrontend -disable-reflection-names -Xfrontend -disable-objc-interop \
1717
// RUN: -I%t -L%t -lLibrary -o %t/main
1818
// RUN: %target-codesign %t/main

test/IRGen/thinlto.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
2-
// RUN: %target-build-swift -parse-as-library -working-directory %t -lto=llvm-thin -DMODULE -static -emit-library -emit-module %s -module-name MyModule
3-
// RUN: %target-build-swift -parse-as-library -working-directory %t -lto=llvm-thin %s -I%t -L%t -lMyModule -module-name main -o %t/main %lto_flags
2+
// RUN: %use_just_built_liblto %target-build-swift -parse-as-library -working-directory %t -lto=llvm-thin -DMODULE -static -emit-library -emit-module %s -module-name MyModule
3+
// RUN: %use_just_built_liblto %target-build-swift -parse-as-library -working-directory %t -lto=llvm-thin %s -I%t -L%t -lMyModule -module-name main -o %t/main %lto_flags
44
// RUN: %target-codesign %t/main
55
// RUN: %target-run %t/main | %FileCheck %s
66

test/Interpreter/llvm_link_time_opt.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
// REQUIRES: no_asan
1010

1111
// RUN: %empty-directory(%t)
12-
// RUN: %target-swiftc_driver -emit-library -static -lto=llvm-full %lto_flags -emit-module %S/Inputs/lto/module1.swift -working-directory %t
13-
// RUN: %target-swiftc_driver -lto=llvm-full %lto_flags %s -I%t -L%t -lmodule1 -module-name main -o %t/main
12+
// RUN: %use_just_built_liblto %target-swiftc_driver -emit-library -static -lto=llvm-full %lto_flags -emit-module %S/Inputs/lto/module1.swift -working-directory %t
13+
// RUN: %use_just_built_liblto %target-swiftc_driver -lto=llvm-full %lto_flags %s -I%t -L%t -lmodule1 -module-name main -o %t/main
1414
// RUN: %llvm-nm --defined-only %t/main | %FileCheck %s
1515

1616
// CHECK-NOT: _$s7module120unusedPublicFunctionyyF

test/Interpreter/lto_static_lib.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %empty-directory(%t)
22
// RUN: %target-build-swift -parse-as-library -lto=llvm-thin %s -emit-bc -o %t/a.o %lto_flags
3-
// RUN: ar -r -s %t/archive.a %t/a.o
4-
// RUN: %target-clang %t/archive.a -isysroot %sdk -L%swift-lib-dir/swift/%target-sdk-name -flto -o %t/main
3+
// RUN: %use_just_built_liblto ar -r -s %t/archive.a %t/a.o
4+
// RUN: %use_just_built_liblto %target-clang %t/archive.a -isysroot %sdk -L%swift-lib-dir/swift/%target-sdk-name -flto -o %t/main
55
// RUN: %target-run %t/main | %FileCheck %s
66

77
// REQUIRES: executable_test

test/lit.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ config.llvm_src_root = getattr(config, 'llvm_src_root', None)
219219
config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
220220

221221
lto_flags = ""
222+
use_just_built_liblto = ""
222223

223224
if platform.system() == 'OpenBSD':
224225
llvm_libs_dir = getattr(config, 'llvm_libs_dir', None)
@@ -231,8 +232,10 @@ elif platform.system() == 'Darwin':
231232
if not llvm_libs_dir:
232233
lit_config.fatal('No LLVM libs dir set.')
233234
lto_flags = "-Xlinker -lto_library -Xlinker %s/libLTO.dylib" % llvm_libs_dir
235+
use_just_built_liblto = "LIBLTO_PATH=%s/libLTO.dylib" % llvm_libs_dir
234236

235237
config.substitutions.append( ('%lto_flags', lto_flags) )
238+
config.substitutions.append( ('%use_just_built_liblto', use_just_built_liblto) )
236239

237240
def append_to_env_path(directory):
238241
config.environment['PATH'] = \

0 commit comments

Comments
 (0)