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 \
8 ; RUN: llvm-dis %t/flat-namespace.dylib.0.2.internalize.bc -o - | FileCheck %s \
9 ; RUN: --check-prefix=NO-DSO-LOCAL
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()
15 ; NO-DSO-LOCAL: define weak_odr void @f()
16 ; NO-DSO-LOCAL: define void @main()
18 target triple = "x86_64-apple-macosx10.15.0"
19 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
21 define weak_odr void @f() {