1 ; RUN: llvm-as %s -o %t.o
2 ; RUN: %ld64 -lto_library %llvmshlibdir/libLTO.dylib -dylib -arch x86_64 -macosx_version_min 10.10.0 -o %t.dylib %t.o -save-temps -undefined dynamic_lookup -exported_symbol _c -exported_symbol _b -exported_symbol _GlobLinkonce -lSystem
4 ; RUN: llvm-dis %t.dylib.lto.opt.bc -o - | FileCheck --check-prefix=IR %s
5 ; check that @a is no longer a linkonce_odr definition
6 ; IR-NOT: define linkonce_odr void @a()
7 ; check that @b is appended in llvm.used
8 ; IR: @llvm.compiler.used = appending global [2 x ptr] [ptr @GlobLinkonce, ptr @b], section "llvm.metadata"
10 ; RUN: llvm-nm %t.dylib | FileCheck --check-prefix=NM %s
11 ; check that the linker can hide @a but not @b, nor @GlobLinkonce
18 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-apple-macosx10.10.0"
21 declare void @external()
23 @GlobLinkonce = linkonce_odr unnamed_addr constant [1 x ptr] [ptr null], align 8
25 define linkonce_odr void @a() noinline {
26 %use_of_GlobLinkonce = load [1 x ptr], ptr@GlobLinkonce
31 define linkonce_odr void @b() {