mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
In LLVM unified builds `%swift_obj_root` points to `<LLVM build dir>/tools/swift`, and folders like `bin`, `lib` and `share` are not under `swift_obj_root`, which makes some tests fail. For the cases in which `%swift_obj_root/lib` was used, replace it by using `%swift-lib-dir` instead. Replicate `%swift-lib-dir` to create `%swift-bin-dir` and `%swift-share-dir`, and use those instead of `%swift_obj_root/bin` and `%swift_obj_root/share`. This alternates work both in Swift build-script builds and also in LLVM unified builds.
18 lines
470 B
Swift
18 lines
470 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift -parse-as-library -lto=llvm-thin %s -emit-bc -o %t/a.o %lto_flags
|
|
// RUN: ar -r -s %t/archive.a %t/a.o
|
|
// RUN: %target-clang %t/archive.a -isysroot %sdk -L%swift-lib-dir/swift/%target-sdk-name -flto -o %t/main
|
|
// RUN: %target-run %t/main | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: OS=macosx
|
|
// REQUIRES: no_asan
|
|
|
|
@_cdecl("main")
|
|
func main() -> Int {
|
|
print("Hello!")
|
|
return 0
|
|
}
|
|
|
|
// CHECK: Hello!
|