2012-11-17 05:12:38 +08:00
|
|
|
; RUN: llc < %s -march=xcore | FileCheck %s
|
2013-11-14 21:58:06 +08:00
|
|
|
define void @a_val() nounwind {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
@b_val = constant i32 42, section ".cp.rodata"
|
|
|
|
@c_val = global i32 42
|
2012-11-17 05:12:38 +08:00
|
|
|
|
2015-09-11 11:22:04 +08:00
|
|
|
@a = alias void (), void ()* @a_val
|
|
|
|
@b = alias i32, i32* @b_val
|
|
|
|
@c = alias i32, i32* @c_val
|
2012-11-17 05:12:38 +08:00
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: a_addr:
|
2012-11-17 05:12:38 +08:00
|
|
|
; CHECK: ldap r11, a
|
|
|
|
; CHECK: retsp
|
|
|
|
define void ()* @a_addr() nounwind {
|
|
|
|
entry:
|
|
|
|
ret void ()* @a
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: b_addr:
|
2012-11-17 05:12:38 +08:00
|
|
|
; CHECK: ldaw r11, cp[b]
|
|
|
|
; CHECK: retsp
|
|
|
|
define i32 *@b_addr() nounwind {
|
|
|
|
entry:
|
|
|
|
ret i32* @b
|
|
|
|
}
|
|
|
|
|
2013-07-14 14:24:09 +08:00
|
|
|
; CHECK-LABEL: c_addr:
|
2012-11-17 05:12:38 +08:00
|
|
|
; CHECK: ldaw r0, dp[c]
|
|
|
|
; CHECK: retsp
|
|
|
|
define i32 *@c_addr() nounwind {
|
|
|
|
entry:
|
|
|
|
ret i32* @c
|
|
|
|
}
|