mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-22 10:29:35 +00:00
An alias to a function should use pc relative addressing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168199 91177308-0d34-0410-b5e6-96231b3b80d8
33 lines
576 B
LLVM
33 lines
576 B
LLVM
; RUN: llc < %s -march=xcore | FileCheck %s
|
|
declare void @a_val() nounwind
|
|
@b_val = external constant i32, section ".cp.rodata"
|
|
@c_val = external global i32
|
|
|
|
@a = alias void ()* @a_val
|
|
@b = alias i32* @b_val
|
|
@c = alias i32* @c_val
|
|
|
|
; CHECK: a_addr:
|
|
; CHECK: ldap r11, a
|
|
; CHECK: retsp
|
|
define void ()* @a_addr() nounwind {
|
|
entry:
|
|
ret void ()* @a
|
|
}
|
|
|
|
; CHECK: b_addr:
|
|
; CHECK: ldaw r11, cp[b]
|
|
; CHECK: retsp
|
|
define i32 *@b_addr() nounwind {
|
|
entry:
|
|
ret i32* @b
|
|
}
|
|
|
|
; CHECK: c_addr:
|
|
; CHECK: ldaw r0, dp[c]
|
|
; CHECK: retsp
|
|
define i32 *@c_addr() nounwind {
|
|
entry:
|
|
ret i32* @c
|
|
}
|