From ac60e5f02848c1220e05bc623aa5de3ddf790bfd Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 1 Feb 2016 19:56:12 +0000 Subject: [PATCH] Add a test for r258362. Thanks to Mehdi for finding it. llvm-svn: 259394 --- llvm/test/Linker/Inputs/funcimport2.ll | 8 ++++++++ llvm/test/Linker/funcimport2.ll | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 llvm/test/Linker/Inputs/funcimport2.ll create mode 100644 llvm/test/Linker/funcimport2.ll diff --git a/llvm/test/Linker/Inputs/funcimport2.ll b/llvm/test/Linker/Inputs/funcimport2.ll new file mode 100644 index 000000000000..4d0ec6c03f62 --- /dev/null +++ b/llvm/test/Linker/Inputs/funcimport2.ll @@ -0,0 +1,8 @@ +define linkonce_odr hidden void @foo() { + ret void +} + +define void @bar() { + call void @foo() + ret void +} diff --git a/llvm/test/Linker/funcimport2.ll b/llvm/test/Linker/funcimport2.ll new file mode 100644 index 000000000000..af10a1378c05 --- /dev/null +++ b/llvm/test/Linker/funcimport2.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as -function-summary %s -o %t1.bc +; RUN: llvm-as -function-summary %p/Inputs/funcimport2.ll -o %t2.bc +; RUN: llvm-lto -thinlto -o %t3 %t1.bc %t2.bc +; RUN: llvm-link -import=bar:%t2.bc %t1.bc -functionindex=%t3.thinlto.bc -S | FileCheck %s + +; CHECK: define linkonce_odr hidden void @foo() { +define available_externally hidden void @foo() { + ret void +} + +declare void @bar() + +define void @caller() { + call void @bar() + call void @foo() + ret void +}