llvm-project
28 строк · 757.0 Байт
1; REQUIRES: x86
2; RUN: rm -rf %t; split-file %s %t
3; RUN: llvm-as %t/archive.ll -o %t/archive.o
4; RUN: llvm-ar rcs %t/archive.a %t/archive.o
5; RUN: llvm-as %t/obj.ll -o %t/obj.o
6
7; RUN: %lld -dylib -lSystem %t/obj.o -load_hidden %t/archive.a -o %t/test.dylib
8; RUN: llvm-nm %t/test.dylib | FileCheck %s
9; CHECK: t _foo
10
11;--- archive.ll
12target triple = "x86_64-apple-macosx10.15.0"
13target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
14
15define void @foo() noinline optnone {
16ret void
17}
18
19;--- obj.ll
20target triple = "x86_64-apple-macosx10.15.0"
21target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
22
23declare void @foo();
24
25define void @main() {
26call void @foo()
27ret void
28}
29