llvm-project
27 строк · 860.0 Байт
1; REQUIRES: x86
2; RUN: rm -rf %t; mkdir %t
3; RUN: llvm-as %s -o %t/test.o
4; RUN: %lld -lSystem -dylib %t/test.o -o %t/test -save-temps
5; RUN: llvm-dis %t/test.0.2.internalize.bc -o - | FileCheck %s
6; RUN: %lld -lSystem -dylib %t/test.o -o %t/flat-namespace.dylib -save-temps \
7; RUN: -flat_namespace
8; RUN: llvm-dis %t/flat-namespace.dylib.0.2.internalize.bc -o - | FileCheck %s \
9; RUN: --check-prefix=NO-DSO-LOCAL
10
11;; f() is never dso_local since it is a weak external.
12; CHECK: define weak_odr void @f()
13; CHECK: define dso_local void @main()
14
15; NO-DSO-LOCAL: define weak_odr void @f()
16; NO-DSO-LOCAL: define void @main()
17
18target triple = "x86_64-apple-macosx10.15.0"
19target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
20
21define weak_odr void @f() {
22ret void
23}
24
25define void @main() {
26ret void
27}
28