llvm/test/Linker/funcimport_comdat.ll
Mehdi Amini e58bfc97e6 Move summary creation out of llvm-as into opt
Summary:
Let keep llvm-as "dumb": it converts textual IR to bitcode. This
commit removes the dependency from llvm-as to libLLVMAnalysis.
We'll add back summary in llvm-as if we get to a textual
representation for it at some point. In the meantime, opt seems
like a better place for that.

Reviewers: tejohnson

Subscribers: joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D19032

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266131 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 21:35:18 +00:00

29 lines
1.2 KiB
LLVM

; Do setup work for all below tests: generate bitcode and combined index
; RUN: opt -module-summary %s -o %t.bc
; RUN: opt -module-summary %p/Inputs/funcimport_comdat.ll -o %t2.bc
; RUN: llvm-lto -thinlto -o %t3 %t.bc %t2.bc
; Ensure linking of comdat containing external linkage global and function
; removes the imported available_externally defs from comdat.
; RUN: llvm-link %t2.bc -summary-index=%t3.thinlto.bc -import=comdat1_func1:%t.bc -S | FileCheck %s --check-prefix=IMPORTCOMDAT
; IMPORTCOMDAT-NOT: $comdat1 = comdat any
; IMPORTCOMDAT-NOT: comdat($comdat1)
; Ensure linking of comdat containing internal linkage function with alias
; removes the imported and promoted available_externally defs from comdat.
; RUN: llvm-link %t2.bc -summary-index=%t3.thinlto.bc -import=comdat2_func1:%t.bc -S | FileCheck %s --check-prefix=IMPORTCOMDAT2
; IMPORTCOMDAT2-NOT: $comdat2 = comdat any
; IMPORTCOMDAT2-NOT: comdat($comdat2)
$comdat1 = comdat any
@comdat1_glob = global i32 0, comdat($comdat1)
define void @comdat1_func1() comdat($comdat1) {
ret void
}
$comdat2 = comdat any
@comdat2_alias = alias void (), void ()* @comdat2_func1
define internal void @comdat2_func1() comdat($comdat2) {
ret void
}