1 ; Test to ensure that dead alias are dropped by converting to a declaration
2 ; RUN: opt -module-summary %s -o %t1.bc
3 ; RUN: llvm-lto2 run %t1.bc -r %t1.bc,barAlias,x \
4 ; RUN: -r %t1.bc,bar,x -r %t1.bc,zed,px \
5 ; RUN: -r %t1.bc,var,x -r %t1.bc,varAlias,x \
6 ; RUN: -o %t2.o -save-temps
8 ; Check that bar and barAlias were dropped to declarations
9 ; RUN: llvm-dis %t2.o.1.1.promote.bc -o - | FileCheck %s --check-prefix=DROP
10 ; DROP-DAG: declare void @bar()
11 ; DROP-DAG: declare void @barAlias()
12 ; DROP-DAG: @var = external global i32
13 ; DROP-DAG: @varAlias = external global i32
15 ; Check that 'barAlias' and 'varAlias' were not inlined.
16 ; RUN: llvm-objdump -d %t2.o.1 | FileCheck %s
18 ; CHECK-NEXT: {{.*}} pushq
19 ; CHECK-NEXT: {{.*}} callq 0
20 ; CHECK-NEXT: movq (%rip), %rax
22 ; Check that 'barAlias' and 'varAlias' produced as undefined.
23 ; RUN: llvm-readelf --symbols %t2.o.1 | FileCheck %s --check-prefix=SYMBOLS
24 ; SYMBOLS: NOTYPE GLOBAL DEFAULT UND barAlias
25 ; SYMBOLS: NOTYPE GLOBAL DEFAULT UND varAlias
26 ; SYMBOLS: FUNC GLOBAL DEFAULT 2 zed
28 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
29 target triple = "x86_64-unknown-linux-gnu"
31 @barAlias = alias void(), void()* @bar
37 @varAlias = alias i32, i32* @var
41 %1 = load i32, i32* @varAlias, align 4