Skip to content

Commit e8830fc

Browse files
authored
Add an LTO test that uses 'ar' to create a static library (#41242)
1 parent c257709 commit e8830fc

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/Interpreter/lto_static_lib.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// RUN: %empty-directory(%t)
2+
// 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_obj_root/lib/swift/%target-sdk-name -flto -o %t/main
5+
// RUN: %target-run %t/main | %FileCheck %s
6+
7+
// REQUIRES: executable_test
8+
// REQUIRES: OS=macosx
9+
// REQUIRES: no_asan
10+
11+
@_cdecl("main")
12+
func main() -> Int {
13+
print("Hello!")
14+
return 0
15+
}
16+
17+
// CHECK: Hello!

0 commit comments

Comments
 (0)