1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/Linker/DSOLocalEquivalent.ll
Leonard Chan bf4eac0c1d [llvm] Change DSOLocalEquivalent type if the underlying global value type changes
We encountered an issue where LTO running on IR that used the DSOLocalEquivalent
constant would result in bad codegen. The underlying issue was ValueMapper wasn't
properly handling DSOLocalEquivalent, so this just adds the machinery for handling
it. This code path is triggered by a fix to DSOLocalEquivalent::handleOperandChangeImpl
where DSOLocalEquivalent could potentially not have the same type as its underlying GV.

This updates DSOLocalEquivalent::handleOperandChangeImpl to change the type if
the GV type changes and handles this constant in ValueMapper.

Differential Revision: https://reviews.llvm.org/D97978
2021-03-09 15:09:48 -08:00

35 lines
1014 B
LLVM

; RUN: llvm-link %s %S/Inputs/DSOLocalEquivalent.ll -S | FileCheck %s
; RUN: llvm-link %S/Inputs/DSOLocalEquivalent.ll %s -S | FileCheck %s
declare void @extern_func()
declare void @defined_extern_func()
declare hidden void @hidden_func()
; CHECK: define void @call_extern_func() {
; CHECK-NEXT: call void dso_local_equivalent @extern_func()
; CHECK-NEXT: ret void
; CHECK-NEXT: }
define void @call_extern_func() {
call void dso_local_equivalent @extern_func()
ret void
}
; CHECK: define void @call_defined_extern_func() {
; CHECK-NEXT: call void dso_local_equivalent @defined_extern_func()
; CHECK-NEXT: ret void
; CHECK-NEXT: }
define void @call_defined_extern_func() {
call void dso_local_equivalent @defined_extern_func()
ret void
}
; CHECK: define void @call_hidden_func() {
; CHECK-NEXT: call void dso_local_equivalent @hidden_func()
; CHECK-NEXT: ret void
; CHECK-NEXT: }
define void @call_hidden_func() {
call void dso_local_equivalent @hidden_func()
ret void
}