brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 19d0fa7 Raw
39 lines · plain
1; RUN: llvm-as %s -o %t.o2; 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 -lSystem3 4; RUN: llvm-dis %t.dylib.lto.opt.bc -o - | FileCheck --check-prefix=IR %s5; check that @a is no longer a linkonce_odr definition6; IR-NOT: define linkonce_odr void @a()7; check that @b is appended in llvm.used8; IR: @llvm.compiler.used = appending global [2 x ptr] [ptr @GlobLinkonce, ptr @b], section "llvm.metadata"9 10; RUN: llvm-nm %t.dylib | FileCheck --check-prefix=NM %s11; check that the linker can hide @a but not @b, nor @GlobLinkonce12; NM:  S _GlobLinkonce13; NM:  t _a14; NM:  T _b15; NM:  T _c16 17 18target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"19target triple = "x86_64-apple-macosx10.10.0"20 21declare void @external()22 23@GlobLinkonce = linkonce_odr unnamed_addr constant [1 x ptr] [ptr null], align 824 25define linkonce_odr void @a() noinline {26  %use_of_GlobLinkonce = load [1 x ptr], ptr@GlobLinkonce27  call void @external()28  ret void29}30 31define linkonce_odr void @b() {32  ret void33}34 35define ptr @c() {36  call void @a()37  ret ptr @b38}39