brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · e7c135c Raw
44 lines · plain
1; Test to ensure that dead alias are dropped by converting to a declaration2; RUN: opt -module-summary %s -o %t1.bc3; 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-temps7 8; Check that bar and barAlias were dropped to declarations9; RUN: llvm-dis %t2.o.1.1.promote.bc -o - | FileCheck %s --check-prefix=DROP10; DROP-DAG: declare void @bar()11; DROP-DAG: declare void @barAlias()12; DROP-DAG: @var = external global i3213; DROP-DAG: @varAlias = external global i3214 15; Check that 'barAlias' and 'varAlias' were not inlined.16; RUN: llvm-objdump -d %t2.o.1 | FileCheck %s17; CHECK:      <zed>:18; CHECK-NEXT:  {{.*}}  pushq19; CHECK-NEXT:  {{.*}}  callq   020; CHECK-NEXT:   movq  (%rip), %rax21 22; Check that 'barAlias' and 'varAlias' produced as undefined.23; RUN: llvm-readelf --symbols %t2.o.1 | FileCheck %s --check-prefix=SYMBOLS24; SYMBOLS: FUNC    GLOBAL DEFAULT    2 zed25; SYMBOLS: NOTYPE  GLOBAL DEFAULT  UND barAlias26; SYMBOLS: NOTYPE  GLOBAL DEFAULT  UND varAlias27 28target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"29target triple = "x86_64-unknown-linux-gnu"30 31@barAlias = alias void(), ptr @bar32define void @bar() {33  ret void34}35 36@var = global i32 9937@varAlias = alias i32, ptr @var38 39define i32 @zed() {40  call void @barAlias()41  %1 = load i32, ptr @varAlias, align 442  ret i32 %143}44