1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
llvm-mirror/test/Linker/funcimport_comdat.ll
Teresa Johnson fc270dff80 [ThinLTO] Remove imported available externally defs from comdats.
Summary:
Available externally definitions are considered declarations for the
linker and eventually dropped. As such they are not allowed to be
in comdats. Remove any such imported functions from comdats.

Reviewers: rafael

Subscribers: davidxl, llvm-commits, joker.eph

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

llvm-svn: 260122
2016-02-08 18:47:20 +00:00

29 lines
1.2 KiB
LLVM

; Do setup work for all below tests: generate bitcode and combined index
; RUN: llvm-as -function-summary %s -o %t.bc
; RUN: llvm-as -function-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 -functionindex=%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 -functionindex=%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
}