mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
38048cdb1c
On ELF and COFF an alias is just another name for a position in the file. There is no way to refer to a position in another file, so an alias to undefined is meaningless. MachO currently doesn't support aliases. The spec has a N_INDR, which when implemented will have a different set of restrictions. Adding support for it shouldn't be harder than any other IR extension. For now, having the IR represent what is actually possible with current tools makes it easier to fix the design of GlobalAlias. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203705 91177308-0d34-0410-b5e6-96231b3b80d8
17 lines
360 B
LLVM
17 lines
360 B
LLVM
; RUN: opt < %s -instcombine -S | grep icmp
|
|
; PR1678
|
|
|
|
@A = alias weak void ()* @B ; <void ()*> [#uses=1]
|
|
|
|
define weak void @B() {
|
|
ret void
|
|
}
|
|
|
|
define i32 @active() {
|
|
entry:
|
|
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
|
|
%tmp1 = icmp ne void ()* @A, null ; <i1> [#uses=1]
|
|
%tmp12 = zext i1 %tmp1 to i32 ; <i32> [#uses=1]
|
|
ret i32 %tmp12
|
|
}
|