1 ; Test to ensure that non-prevailing weak aliasee is kept as a weak definition
2 ; when the alias is not dead.
3 ; RUN: opt -module-summary %s -o %t1.bc
4 ; 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-temps
11 ; Check that __a is kept as a weak def. __b can be dropped since its alias is
12 ; not live and will also be dropped.
13 ; RUN: llvm-dis %t2.o.1.1.promote.bc -o - | FileCheck %s
14 ; CHECK: define weak hidden void @__a
15 ; CHECK: declare hidden void @__b
16 ; CHECK: declare void @b
18 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-unknown-linux-gnu"
21 @a = hidden alias void (), void ()* @__a
23 define weak hidden void @__a() {
28 @b = hidden alias void (), void ()* @__b
30 define weak hidden void @__b() {