mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-24 06:30:19 +00:00
d6e5cbc842
This fixes the original testcase in PR8927. It also causes a clang binary built with a patched clang to increase in size by 0.21%. We can probably get some of the size back by writing a pass that detects that a global never has its pointer compared and adds unnamed_addr to it (maybe extend global opt). It is also possible that there are some other cases clang could add unnamed_addr to. I will investigate extending globalopt next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123584 91177308-0d34-0410-b5e6-96231b3b80d8
19 lines
472 B
LLVM
19 lines
472 B
LLVM
; RUN: opt -constmerge %s -S -o - | FileCheck %s
|
|
; PR8978
|
|
|
|
declare i32 @zed(%struct.foobar*, %struct.foobar*)
|
|
|
|
%struct.foobar = type { i32 }
|
|
; CHECK: bar.d
|
|
@bar.d = unnamed_addr constant %struct.foobar zeroinitializer, align 4
|
|
; CHECK-NOT: foo.d
|
|
@foo.d = internal constant %struct.foobar zeroinitializer, align 4
|
|
define i32 @main() nounwind ssp {
|
|
entry:
|
|
; CHECK: bar.d
|
|
%call2 = tail call i32 @zed(%struct.foobar* @foo.d, %struct.foobar* @bar.d)
|
|
nounwind
|
|
ret i32 0
|
|
}
|
|
|