Since we're using tLDRpci to access it, the constant pool's address must be 0
(mod 4).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249163
91177308-0d34-0410-b5e6-
96231b3b80d8
ARMConstantPoolValue *NewCPV = ARMConstantPoolSymbol::Create(
MF.getFunction()->getContext(), "__STACK_LIMIT", PCLabelId, 0);
MachineConstantPool *MCP = MF.getConstantPool();
ARMConstantPoolValue *NewCPV = ARMConstantPoolSymbol::Create(
MF.getFunction()->getContext(), "__STACK_LIMIT", PCLabelId, 0);
MachineConstantPool *MCP = MF.getConstantPool();
- unsigned CPI = MCP->getConstantPoolIndex(NewCPV, MF.getAlignment());
+ unsigned CPI = MCP->getConstantPoolIndex(NewCPV, 4);
// ldr SR0, [pc, offset(STACK_LIMIT)]
AddDefaultPred(BuildMI(GetMBB, DL, TII.get(ARM::tLDRpci), ScratchReg0)
// ldr SR0, [pc, offset(STACK_LIMIT)]
AddDefaultPred(BuildMI(GetMBB, DL, TII.get(ARM::tLDRpci), ScratchReg0)
call void @dummy_use (i32* %mem, i32 10)
ret void
call void @dummy_use (i32* %mem, i32 10)
ret void
-; Thumb-android: test_basic:
+; Thumb-android-LABEL: test_basic:
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: pop {r4, r5}
; Thumb-android: pop {r4, r5}
-; Thumb-linux: test_basic:
+; Thumb-android: .align 2
+; Thumb-android: .LCPI0_0:
+; Thumb-android-NEXT: .long __STACK_LIMIT
+
+; Thumb-linux-LABEL: test_basic:
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
call void @dummy_use (i32* %mem, i32 10)
ret i32 %result
call void @dummy_use (i32* %mem, i32 10)
ret i32 %result
-; Thumb-android: test_nested:
+; Thumb-android-LABEL: test_nested:
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: pop {r4, r5}
; Thumb-android: pop {r4, r5}
-; Thumb-linux: test_nested:
+; Thumb-linux-LABEL: test_nested:
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
call void @dummy_use (i32* %mem, i32 0)
ret void
call void @dummy_use (i32* %mem, i32 0)
ret void
-; Thumb-android: test_large:
+; Thumb-android-LABEL: test_large:
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: pop {r4, r5}
; Thumb-android: pop {r4, r5}
-; Thumb-linux: test_large:
+; Thumb-linux-LABEL: test_large:
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
call void @dummy_use (i32* %mem, i32 10)
ret void
call void @dummy_use (i32* %mem, i32 10)
ret void
-; Thumb-android: test_fastcc:
+; Thumb-android-LABEL: test_fastcc:
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: pop {r4, r5}
; Thumb-android: pop {r4, r5}
-; Thumb-linux: test_fastcc:
+; Thumb-linux-LABEL: test_fastcc:
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
call void @dummy_use (i32* %mem, i32 0)
ret void
call void @dummy_use (i32* %mem, i32 0)
ret void
-; Thumb-android: test_fastcc_large:
+; Thumb-android-LABEL: test_fastcc_large:
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: push {r4, r5}
; Thumb-android-NEXT: mov r5, sp
; Thumb-android: pop {r4, r5}
; Thumb-android: pop {r4, r5}
-; Thumb-linux: test_fastcc_large:
+; Thumb-linux-LABEL: test_fastcc_large:
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp
; Thumb-linux: push {r4, r5}
; Thumb-linux-NEXT: mov r5, sp