xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/2010-05-18-PostIndexBug.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-apple-darwin   | FileCheck %s -check-prefix=ARM
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-apple-darwin | FileCheck %s -check-prefix=THUMB
3*9880d681SAndroid Build Coastguard Worker; rdar://7998649
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker%struct.foo = type { i64, i64 }
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Workerdefine zeroext i8 @t(%struct.foo* %this, i1 %tst) noreturn optsize {
8*9880d681SAndroid Build Coastguard Workerentry:
9*9880d681SAndroid Build Coastguard Worker; ARM-LABEL:       t:
10*9880d681SAndroid Build Coastguard Worker; ARM-DAG:       mov r[[ADDR:[0-9]+]], #8
11*9880d681SAndroid Build Coastguard Worker; ARM-DAG:       mov [[VAL:r[0-9]+]], #0
12*9880d681SAndroid Build Coastguard Worker; ARM:       str [[VAL]], [r[[ADDR]]], r0
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Worker; THUMB-LABEL:     t:
15*9880d681SAndroid Build Coastguard Worker; THUMB-DAG:       movs r[[ADDR:[0-9]+]], #8
16*9880d681SAndroid Build Coastguard Worker; THUMB-DAG:       movs [[VAL:r[0-9]+]], #0
17*9880d681SAndroid Build Coastguard Worker; THUMB-NOT: str {{[a-z0-9]+}}, [{{[a-z0-9]+}}], {{[a-z0-9]+}}
18*9880d681SAndroid Build Coastguard Worker; THUMB:     str [[VAL]], [r[[ADDR]]]
19*9880d681SAndroid Build Coastguard Worker  %0 = getelementptr inbounds %struct.foo, %struct.foo* %this, i32 0, i32 1 ; <i64*> [#uses=1]
20*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* inttoptr (i32 8 to i32*), align 8
21*9880d681SAndroid Build Coastguard Worker  br i1 %tst, label %bb.nph96, label %bb3
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerbb3:                                              ; preds = %entry
24*9880d681SAndroid Build Coastguard Worker  %1 = load i64, i64* %0, align 4                      ; <i64> [#uses=0]
25*9880d681SAndroid Build Coastguard Worker  ret i8 42
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Workerbb.nph96:                                         ; preds = %entry
28*9880d681SAndroid Build Coastguard Worker  ret i8 3
29*9880d681SAndroid Build Coastguard Worker}
30