brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 1251c0a Raw
43 lines · plain
1; RUN: llvm-as < %s >%t12; RUN: llvm-lto -o %t2 %t13; RUN: llvm-nm %t2 | FileCheck %s -check-prefix=NOEXPORT4; RUN: llvm-lto -o %t3 -exported-symbol=main %t15; RUN: llvm-nm %t3 | FileCheck %s -check-prefix=EXPORT6 7target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"8target triple = "x86_64-unknown-linux-gnu"9 10module asm ".text"11module asm ".align 16, 0x90"12module asm ".type PR14512, @function"13module asm "PR14512:.cfi_startproc"14module asm "ret"15module asm ".cfi_endproc"16 17declare void @PR14512()18 19; Without -exported-symbol, main should be eliminated by LTO.20; With -exported-symbol=main, main should be preserved by LTO.21define i32 @main(i32 %argc, ptr %argv) {22; NOEXPORT-NOT: main23; EXPORT: main24  call void @PR14512()25  ret i32 026}27 28; RUN: llvm-lto -o %t -dso-symbol=zed1 -dso-symbol=zed2 %t1 -O029; RUN: llvm-nm %t | FileCheck %s -check-prefix=ZED1_AND_ZED230; ZED1_AND_ZED2: V zed131@zed1 = linkonce_odr global i32 4232define ptr @get_zed1() {33  ret ptr @zed134}35 36; ZED1_AND_ZED2: r zed237@zed2 = linkonce_odr unnamed_addr constant i32 4238 39define i32 @useZed2() {40  %x = load i32, ptr @zed241  ret i32 %x42}43