34 lines · plain
1; Test to ensure that non-prevailing weak aliasee is kept as a weak definition2; when the alias is not dead.3; RUN: opt -module-summary %s -o %t1.bc4; RUN: llvm-lto2 run %t1.bc \5; RUN: -r=%t1.bc,__a,lx \6; RUN: -r=%t1.bc,__b,l \7; RUN: -r=%t1.bc,a,plx \8; RUN: -r=%t1.bc,b,pl \9; RUN: -o %t2.o -save-temps10 11; Check that __a is kept as a weak def. __b can be dropped since its alias is12; not live and will also be dropped.13; RUN: llvm-dis %t2.o.1.1.promote.bc -o - | FileCheck %s14; CHECK: define weak hidden void @__a15; CHECK: declare hidden void @__b16; CHECK: declare void @b17 18target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"19target triple = "x86_64-unknown-linux-gnu"20 21@a = hidden alias void (), ptr @__a22 23define weak hidden void @__a() {24entry:25 ret void26}27 28@b = hidden alias void (), ptr @__b29 30define weak hidden void @__b() {31entry:32 ret void33}34