• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -o - %s -mtriple=thumbv7-- -run-pass=stack-protector -run-pass=prologepilog | FileCheck %s
3---
4# This should trigger an emergency spill in the register scavenger because the
5# frame offset into the large argument is too large.
6name: func0
7tracksRegLiveness: true
8fixedStack:
9  - { id: 0, offset: 4084, size: 4, alignment: 4, isImmutable: true,
10      isAliased: false }
11  - { id: 1, offset: -12, size: 4096, alignment: 4, isImmutable: false,
12      isAliased: false }
13body: |
14  bb.0:
15    ; CHECK-LABEL: name: func0
16    ; CHECK: liveins: $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11, $lr
17    ; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r4, killed $r5, killed $r6, killed $r7, killed $r8, killed $r9, killed $r10, killed $r11, killed $lr
18    ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 36
19    ; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -16
20    ; CHECK: frame-setup CFI_INSTRUCTION offset $r11, -20
21    ; CHECK: frame-setup CFI_INSTRUCTION offset $r10, -24
22    ; CHECK: frame-setup CFI_INSTRUCTION offset $r9, -28
23    ; CHECK: frame-setup CFI_INSTRUCTION offset $r8, -32
24    ; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -36
25    ; CHECK: frame-setup CFI_INSTRUCTION offset $r6, -40
26    ; CHECK: frame-setup CFI_INSTRUCTION offset $r5, -44
27    ; CHECK: frame-setup CFI_INSTRUCTION offset $r4, -48
28    ; CHECK: $sp = frame-setup tSUBspi $sp, 4, 14 /* CC::al */, $noreg
29    ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 52
30    ; CHECK: $r0 = IMPLICIT_DEF
31    ; CHECK: $r1 = IMPLICIT_DEF
32    ; CHECK: $r2 = IMPLICIT_DEF
33    ; CHECK: $r3 = IMPLICIT_DEF
34    ; CHECK: $r4 = IMPLICIT_DEF
35    ; CHECK: $r5 = IMPLICIT_DEF
36    ; CHECK: $r6 = IMPLICIT_DEF
37    ; CHECK: $r7 = IMPLICIT_DEF
38    ; CHECK: $r8 = IMPLICIT_DEF
39    ; CHECK: $r9 = IMPLICIT_DEF
40    ; CHECK: $r10 = IMPLICIT_DEF
41    ; CHECK: $r11 = IMPLICIT_DEF
42    ; CHECK: $r12 = IMPLICIT_DEF
43    ; CHECK: $lr = IMPLICIT_DEF
44    ; CHECK: t2STRi12 killed $r0, $sp, 0, 14 /* CC::al */, $noreg :: (store 4 into %stack.0)
45    ; CHECK: $r0 = t2ADDri killed $sp, 4096, 14 /* CC::al */, $noreg, $noreg
46    ; CHECK: $sp = t2LDRi12 killed $r0, 40, 14 /* CC::al */, $noreg :: (load 4)
47    ; CHECK: $r0 = t2LDRi12 $sp, 0, 14 /* CC::al */, $noreg :: (load 4 from %stack.0)
48    ; CHECK: KILL $r0
49    ; CHECK: KILL $r1
50    ; CHECK: KILL $r2
51    ; CHECK: KILL $r3
52    ; CHECK: KILL $r4
53    ; CHECK: KILL $r5
54    ; CHECK: KILL $r6
55    ; CHECK: KILL $r7
56    ; CHECK: KILL $r8
57    ; CHECK: KILL $r9
58    ; CHECK: KILL $r10
59    ; CHECK: KILL $r11
60    ; CHECK: KILL $r12
61    ; CHECK: KILL $lr
62    $r0 = IMPLICIT_DEF
63    $r1 = IMPLICIT_DEF
64    $r2 = IMPLICIT_DEF
65    $r3 = IMPLICIT_DEF
66    $r4 = IMPLICIT_DEF
67    $r5 = IMPLICIT_DEF
68    $r6 = IMPLICIT_DEF
69    $r7 = IMPLICIT_DEF
70    $r8 = IMPLICIT_DEF
71    $r9 = IMPLICIT_DEF
72    $r10 = IMPLICIT_DEF
73    $r11 = IMPLICIT_DEF
74    $r12 = IMPLICIT_DEF
75    $lr = IMPLICIT_DEF
76
77    $sp = t2LDRi12 %fixed-stack.0, 0, 14, $noreg :: (load 4)
78
79    KILL $r0
80    KILL $r1
81    KILL $r2
82    KILL $r3
83    KILL $r4
84    KILL $r5
85    KILL $r6
86    KILL $r7
87    KILL $r8
88    KILL $r9
89    KILL $r10
90    KILL $r11
91    KILL $r12
92    KILL $lr
93...
94---
95# This should not trigger an emergency spill yet.
96name: func1
97tracksRegLiveness: true
98fixedStack:
99  - { id: 0, offset: 4044, size: 4, alignment: 4, isImmutable: true,
100      isAliased: false }
101  - { id: 1, offset: -12, size: 4056, alignment: 4, isImmutable: false,
102      isAliased: false }
103body: |
104  bb.0:
105    ; CHECK-LABEL: name: func1
106    ; CHECK: liveins: $r4, $r5, $r6, $r8, $r9, $r10, $r11, $lr
107    ; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r4, killed $r5, killed $r6, killed $r8, killed $r9, killed $r10, killed $r11, killed $lr
108    ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 32
109    ; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -16
110    ; CHECK: frame-setup CFI_INSTRUCTION offset $r11, -20
111    ; CHECK: frame-setup CFI_INSTRUCTION offset $r10, -24
112    ; CHECK: frame-setup CFI_INSTRUCTION offset $r9, -28
113    ; CHECK: frame-setup CFI_INSTRUCTION offset $r8, -32
114    ; CHECK: frame-setup CFI_INSTRUCTION offset $r6, -36
115    ; CHECK: frame-setup CFI_INSTRUCTION offset $r5, -40
116    ; CHECK: frame-setup CFI_INSTRUCTION offset $r4, -44
117    ; CHECK: $sp = frame-setup tSUBspi $sp, 4, 14 /* CC::al */, $noreg
118    ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 48
119    ; CHECK: $r0 = IMPLICIT_DEF
120    ; CHECK: $r1 = IMPLICIT_DEF
121    ; CHECK: $r2 = IMPLICIT_DEF
122    ; CHECK: $r3 = IMPLICIT_DEF
123    ; CHECK: $r4 = IMPLICIT_DEF
124    ; CHECK: $r5 = IMPLICIT_DEF
125    ; CHECK: $r6 = IMPLICIT_DEF
126    ; CHECK: $r8 = IMPLICIT_DEF
127    ; CHECK: $r9 = IMPLICIT_DEF
128    ; CHECK: $r10 = IMPLICIT_DEF
129    ; CHECK: $r11 = IMPLICIT_DEF
130    ; CHECK: $r12 = IMPLICIT_DEF
131    ; CHECK: $lr = IMPLICIT_DEF
132    ; CHECK: $r11 = t2LDRi12 $sp, 4092, 14 /* CC::al */, $noreg :: (load 4)
133    ; CHECK: KILL $r0
134    ; CHECK: KILL $r1
135    ; CHECK: KILL $r2
136    ; CHECK: KILL $r3
137    ; CHECK: KILL $r4
138    ; CHECK: KILL $r5
139    ; CHECK: KILL $r6
140    ; CHECK: KILL $r8
141    ; CHECK: KILL $r9
142    ; CHECK: KILL $r10
143    ; CHECK: KILL $r11
144    ; CHECK: KILL $r12
145    ; CHECK: KILL $lr
146    $r0 = IMPLICIT_DEF
147    $r1 = IMPLICIT_DEF
148    $r2 = IMPLICIT_DEF
149    $r3 = IMPLICIT_DEF
150    $r4 = IMPLICIT_DEF
151    $r5 = IMPLICIT_DEF
152    $r6 = IMPLICIT_DEF
153    $r8 = IMPLICIT_DEF
154    $r9 = IMPLICIT_DEF
155    $r10 = IMPLICIT_DEF
156    $r11 = IMPLICIT_DEF
157    $r12 = IMPLICIT_DEF
158    $lr = IMPLICIT_DEF
159
160    $r11 = t2LDRi12 %fixed-stack.0, 0, 14, $noreg :: (load 4)
161
162    KILL $r0
163    KILL $r1
164    KILL $r2
165    KILL $r3
166    KILL $r4
167    KILL $r5
168    KILL $r6
169    KILL $r8
170    KILL $r9
171    KILL $r10
172    KILL $r11
173    KILL $r12
174    KILL $lr
175...
176