xref: /aosp_15_r20/external/llvm/test/CodeGen/Thumb2/ldr-str-imm12.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=thumbv7-apple-darwin -arm-atomic-cfg-tidy=0 -mcpu=cortex-a8 -relocation-model=pic -disable-fp-elim | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; rdar://7352504
3*9880d681SAndroid Build Coastguard Worker; Make sure we use "str r9, [sp, #+28]" instead of "sub.w r4, r7, #256" followed by "str r9, [r4, #-32]".
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker%0 = type { i16, i8, i8 }
6*9880d681SAndroid Build Coastguard Worker%1 = type { [2 x i32], [2 x i32] }
7*9880d681SAndroid Build Coastguard Worker%2 = type { %union.rec* }
8*9880d681SAndroid Build Coastguard Worker%struct.FILE_POS = type { i8, i8, i16, i32 }
9*9880d681SAndroid Build Coastguard Worker%struct.GAP = type { i8, i8, i16 }
10*9880d681SAndroid Build Coastguard Worker%struct.LIST = type { %union.rec*, %union.rec* }
11*9880d681SAndroid Build Coastguard Worker%struct.STYLE = type { %union.anon, %union.anon, i16, i16, i32 }
12*9880d681SAndroid Build Coastguard Worker%struct.head_type = type { [2 x %struct.LIST], %union.FIRST_UNION, %union.SECOND_UNION, %union.THIRD_UNION, %union.FOURTH_UNION, %union.rec*, %2, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, %union.rec*, i32 }
13*9880d681SAndroid Build Coastguard Worker%union.FIRST_UNION = type { %struct.FILE_POS }
14*9880d681SAndroid Build Coastguard Worker%union.FOURTH_UNION = type { %struct.STYLE }
15*9880d681SAndroid Build Coastguard Worker%union.SECOND_UNION = type { %0 }
16*9880d681SAndroid Build Coastguard Worker%union.THIRD_UNION = type { %1 }
17*9880d681SAndroid Build Coastguard Worker%union.anon = type { %struct.GAP }
18*9880d681SAndroid Build Coastguard Worker%union.rec = type { %struct.head_type }
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Worker@zz_hold = external global %union.rec*            ; <%union.rec**> [#uses=2]
21*9880d681SAndroid Build Coastguard Worker@zz_res = external global %union.rec*             ; <%union.rec**> [#uses=1]
22*9880d681SAndroid Build Coastguard Worker
23*9880d681SAndroid Build Coastguard Workerdefine %union.rec* @Manifest(%union.rec* %x, %union.rec* %env, %struct.STYLE* %style, %union.rec** %bthr, %union.rec** %fthr, %union.rec** %target, %union.rec** %crs, i32 %ok, i32 %need_expand, %union.rec** %enclose, i32 %fcr) nounwind {
24*9880d681SAndroid Build Coastguard Workerentry:
25*9880d681SAndroid Build Coastguard Worker; CHECK:       ldr{{(.w)?}}	{{(r[0-9]+)|(lr)}}, [r7, #28]
26*9880d681SAndroid Build Coastguard Worker  %xgaps.i = alloca [32 x %union.rec*], align 4   ; <[32 x %union.rec*]*> [#uses=0]
27*9880d681SAndroid Build Coastguard Worker  %ycomp.i = alloca [32 x %union.rec*], align 4   ; <[32 x %union.rec*]*> [#uses=0]
28*9880d681SAndroid Build Coastguard Worker  br label %bb20
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard Workerbb20:                                             ; preds = %entry
31*9880d681SAndroid Build Coastguard Worker  switch i32 undef, label %bb1287 [
32*9880d681SAndroid Build Coastguard Worker    i32 110, label %bb119
33*9880d681SAndroid Build Coastguard Worker    i32 120, label %bb119
34*9880d681SAndroid Build Coastguard Worker    i32 210, label %bb420
35*9880d681SAndroid Build Coastguard Worker    i32 230, label %bb420
36*9880d681SAndroid Build Coastguard Worker    i32 450, label %bb438
37*9880d681SAndroid Build Coastguard Worker    i32 460, label %bb438
38*9880d681SAndroid Build Coastguard Worker    i32 550, label %bb533
39*9880d681SAndroid Build Coastguard Worker    i32 560, label %bb569
40*9880d681SAndroid Build Coastguard Worker    i32 640, label %bb745
41*9880d681SAndroid Build Coastguard Worker    i32 780, label %bb1098
42*9880d681SAndroid Build Coastguard Worker  ]
43*9880d681SAndroid Build Coastguard Worker
44*9880d681SAndroid Build Coastguard Workerbb119:                                            ; preds = %bb20, %bb20
45*9880d681SAndroid Build Coastguard Worker  unreachable
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Workerbb420:                                            ; preds = %bb20, %bb20
48*9880d681SAndroid Build Coastguard Worker; CHECK: bb420
49*9880d681SAndroid Build Coastguard Worker; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
50*9880d681SAndroid Build Coastguard Worker; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
51*9880d681SAndroid Build Coastguard Worker; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
52*9880d681SAndroid Build Coastguard Worker; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp
53*9880d681SAndroid Build Coastguard Worker  store %union.rec* null, %union.rec** @zz_hold, align 4
54*9880d681SAndroid Build Coastguard Worker  store %union.rec* null, %union.rec** @zz_res, align 4
55*9880d681SAndroid Build Coastguard Worker  store %union.rec* %x, %union.rec** @zz_hold, align 4
56*9880d681SAndroid Build Coastguard Worker  %0 = call  %union.rec* @Manifest(%union.rec* undef, %union.rec* %env, %struct.STYLE* %style, %union.rec** %bthr, %union.rec** %fthr, %union.rec** %target, %union.rec** %crs, i32 %ok, i32 %need_expand, %union.rec** %enclose, i32 %fcr) nounwind ; <%union.rec*> [#uses=0]
57*9880d681SAndroid Build Coastguard Worker  unreachable
58*9880d681SAndroid Build Coastguard Worker
59*9880d681SAndroid Build Coastguard Workerbb438:                                            ; preds = %bb20, %bb20
60*9880d681SAndroid Build Coastguard Worker  unreachable
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard Workerbb533:                                            ; preds = %bb20
63*9880d681SAndroid Build Coastguard Worker  ret %union.rec* %x
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard Workerbb569:                                            ; preds = %bb20
66*9880d681SAndroid Build Coastguard Worker  unreachable
67*9880d681SAndroid Build Coastguard Worker
68*9880d681SAndroid Build Coastguard Workerbb745:                                            ; preds = %bb20
69*9880d681SAndroid Build Coastguard Worker  unreachable
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard Workerbb1098:                                           ; preds = %bb20
72*9880d681SAndroid Build Coastguard Worker  unreachable
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard Workerbb1287:                                           ; preds = %bb20
75*9880d681SAndroid Build Coastguard Worker  unreachable
76*9880d681SAndroid Build Coastguard Worker}
77