brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · ef50737 Raw
43 lines · plain
1; REQUIRES: x862; RUN: rm -rf %t && mkdir %t && cd %t3 4; LTO5; RUN: llvm-as %s -o a.o6; RUN: llvm-as %S/Inputs/defsym-bar.ll -o b.o7; RUN: ld.lld a.o b.o -shared -o a.so -defsym=bar2=bar3 -save-temps8; RUN: llvm-readelf --symbols a.so.lto.o | FileCheck --check-prefix=OBJ %s9; RUN: llvm-objdump -d a.so | FileCheck %s10 11; ThinLTO12; RUN: opt -module-summary %s -o a.o13; RUN: opt -module-summary %S/Inputs/defsym-bar.ll -o b.o14; RUN: ld.lld a.o b.o -shared -o a2.so -defsym=bar2=bar3 -save-temps15; RUN: llvm-readelf --symbols a2.so.lto.a.o | FileCheck --check-prefix=OBJ %s16; RUN: llvm-objdump -d a2.so | FileCheck %s17 18; OBJ:  UND bar219 20; Call to bar2() should not be inlined and should be routed to bar3()21; Symbol bar3 should not be eliminated22 23; CHECK:      <foo>:24; CHECK-NEXT: pushq %rax25; CHECK-NEXT: callq26; CHECK-NEXT: callq{{.*}}<bar3>27; CHECK-NEXT: popq %rax28; CHECK-NEXT: jmp29 30target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"31target triple = "x86_64-unknown-linux-gnu"32 33declare void @bar1()34declare void @bar2()35declare void @bar3()36 37define void @foo() {38  call void @bar1()39  call void @bar2()40  call void @bar3()41  ret void42}43