1 ; RUN: llc < %s -march=xcore | FileCheck %s
3 ; Don't fold negative offsets into cp / dp accesses to avoid a relocation
4 ; error if the address + addend is less than the start of the cp / dp.
6 @a = external constant [0 x i32], section ".cp.rodata"
7 @b = external global [0 x i32]
9 define i32 *@f() nounwind {
12 ; CHECK: ldaw r11, cp[a]
13 ; CHECK: sub r0, r11, 4
14 %0 = getelementptr [0 x i32]* @a, i32 0, i32 -1
18 define i32 *@g() nounwind {
21 ; CHECK: ldaw [[REG:r[0-9]+]], dp[b]
22 ; CHECK: sub r0, [[REG]], 4
23 %0 = getelementptr [0 x i32]* @b, i32 0, i32 -1