1; REQUIRES: x86 2; RUN: rm -rf %t && mkdir %t && cd %t 3 4; LTO 5; RUN: llvm-as %s -o a.o 6; RUN: llvm-as %S/Inputs/defsym-bar.ll -o b.o 7; RUN: ld.lld a.o b.o -shared -o a.so -defsym=bar2=bar3 -save-temps 8; RUN: llvm-readelf --symbols a.so.lto.o | FileCheck --check-prefix=OBJ %s 9; RUN: llvm-objdump -d a.so | FileCheck %s 10 11; ThinLTO 12; RUN: opt -module-summary %s -o a.o 13; RUN: opt -module-summary %S/Inputs/defsym-bar.ll -o b.o 14; RUN: ld.lld a.o b.o -shared -o a2.so -defsym=bar2=bar3 -save-temps 15; RUN: llvm-readelf --symbols a2.so.lto.a.o | FileCheck --check-prefix=OBJ %s 16; RUN: llvm-objdump -d a2.so | FileCheck %s 17 18; OBJ: UND bar2 19 20; Call to bar2() should not be inlined and should be routed to bar3() 21; Symbol bar3 should not be eliminated 22 23; CHECK: <foo>: 24; CHECK-NEXT: pushq %rax 25; CHECK-NEXT: callq 26; CHECK-NEXT: callq{{.*}}<bar3> 27; CHECK-NEXT: popq %rax 28; CHECK-NEXT: jmp 29 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 void 42} 43