1 ; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -verify-machineinstrs | FileCheck %s -check-prefix=X32-Linux
2 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -verify-machineinstrs | FileCheck %s -check-prefix=X64-Linux
3 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -verify-machineinstrs | FileCheck %s -check-prefix=X32ABI
4 ; RUN: llc < %s -mcpu=generic -mtriple=i686-darwin -verify-machineinstrs | FileCheck %s -check-prefix=X32-Darwin
5 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -verify-machineinstrs | FileCheck %s -check-prefix=X64-Darwin
6 ; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -verify-machineinstrs | FileCheck %s -check-prefix=X32-MinGW
7 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -verify-machineinstrs | FileCheck %s -check-prefix=X64-FreeBSD
8 ; RUN: llc < %s -mcpu=generic -mtriple=i686-dragonfly -verify-machineinstrs | FileCheck %s -check-prefix=X32-DFlyBSD
9 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-dragonfly -verify-machineinstrs | FileCheck %s -check-prefix=X64-DFlyBSD
10 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -verify-machineinstrs | FileCheck %s -check-prefix=X64-MinGW
12 ; We used to crash with filetype=obj
13 ; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -filetype=obj
14 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -filetype=obj
15 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -filetype=obj
16 ; RUN: llc < %s -mcpu=generic -mtriple=i686-darwin -filetype=obj
17 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -filetype=obj
18 ; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -filetype=obj
19 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -filetype=obj
20 ; RUN: llc < %s -mcpu=generic -mtriple=i686-dragonfly -filetype=obj
21 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-dragonfly -filetype=obj
22 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -filetype=obj
24 ; RUN: not llc < %s -mcpu=generic -mtriple=x86_64-solaris 2> %t.log
25 ; RUN: FileCheck %s -input-file=%t.log -check-prefix=X64-Solaris
26 ; RUN: not llc < %s -mcpu=generic -mtriple=i686-freebsd 2> %t.log
27 ; RUN: FileCheck %s -input-file=%t.log -check-prefix=X32-FreeBSD
29 ; X64-Solaris: Segmented stacks not supported on this platform
30 ; X32-FreeBSD: Segmented stacks not supported on FreeBSD i386
32 ; Just to prevent the alloca from being optimized away
33 declare void @dummy_use(i32*, i32)
35 define void @test_basic() #0 {
36 %mem = alloca i32, i32 10
37 call void @dummy_use (i32* %mem, i32 10)
40 ; X32-Linux-LABEL: test_basic:
42 ; X32-Linux: cmpl %gs:48, %esp
43 ; X32-Linux-NEXT: ja .LBB0_2
46 ; X32-Linux-NEXT: pushl $60
47 ; X32-Linux-NEXT: calll __morestack
50 ; X64-Linux-LABEL: test_basic:
52 ; X64-Linux: cmpq %fs:112, %rsp
53 ; X64-Linux-NEXT: ja .LBB0_2
55 ; X64-Linux: movabsq $40, %r10
56 ; X64-Linux-NEXT: movabsq $0, %r11
57 ; X64-Linux-NEXT: callq __morestack
60 ; X32ABI-LABEL: test_basic:
62 ; X32ABI: cmpl %fs:64, %esp
63 ; X32ABI-NEXT: ja .LBB0_2
65 ; X32ABI: movl $40, %r10d
66 ; X32ABI-NEXT: movl $0, %r11d
67 ; X32ABI-NEXT: callq __morestack
70 ; X32-Darwin-LABEL: test_basic:
72 ; X32-Darwin: movl $432, %ecx
73 ; X32-Darwin-NEXT: cmpl %gs:(%ecx), %esp
74 ; X32-Darwin-NEXT: ja LBB0_2
76 ; X32-Darwin: pushl $0
77 ; X32-Darwin-NEXT: pushl $60
78 ; X32-Darwin-NEXT: calll ___morestack
79 ; X32-Darwin-NEXT: ret
81 ; X64-Darwin-LABEL: test_basic:
83 ; X64-Darwin: cmpq %gs:816, %rsp
84 ; X64-Darwin-NEXT: ja LBB0_2
86 ; X64-Darwin: movabsq $40, %r10
87 ; X64-Darwin-NEXT: movabsq $0, %r11
88 ; X64-Darwin-NEXT: callq ___morestack
89 ; X64-Darwin-NEXT: ret
91 ; X32-MinGW-LABEL: test_basic:
93 ; X32-MinGW: cmpl %fs:20, %esp
94 ; X32-MinGW-NEXT: ja LBB0_2
97 ; X32-MinGW-NEXT: pushl $48
98 ; X32-MinGW-NEXT: calll ___morestack
101 ; X64-MinGW-LABEL: test_basic:
103 ; X64-MinGW: cmpq %gs:40, %rsp
104 ; X64-MinGW-NEXT: ja .LBB0_2
106 ; X64-MinGW: movabsq $72, %r10
107 ; X64-MinGW-NEXT: movabsq $32, %r11
108 ; X64-MinGW-NEXT: callq __morestack
109 ; X64-MinGW-NEXT: retq
111 ; X64-FreeBSD-LABEL: test_basic:
113 ; X64-FreeBSD: cmpq %fs:24, %rsp
114 ; X64-FreeBSD-NEXT: ja .LBB0_2
116 ; X64-FreeBSD: movabsq $40, %r10
117 ; X64-FreeBSD-NEXT: movabsq $0, %r11
118 ; X64-FreeBSD-NEXT: callq __morestack
119 ; X64-FreeBSD-NEXT: ret
121 ; X32-DFlyBSD-LABEL: test_basic:
123 ; X32-DFlyBSD: cmpl %fs:16, %esp
124 ; X32-DFlyBSD-NEXT: ja .LBB0_2
126 ; X32-DFlyBSD: pushl $0
127 ; X32-DFlyBSD-NEXT: pushl $48
128 ; X32-DFlyBSD-NEXT: calll __morestack
129 ; X32-DFlyBSD-NEXT: ret
131 ; X64-DFlyBSD-LABEL: test_basic:
133 ; X64-DFlyBSD: cmpq %fs:32, %rsp
134 ; X64-DFlyBSD-NEXT: ja .LBB0_2
136 ; X64-DFlyBSD: movabsq $40, %r10
137 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
138 ; X64-DFlyBSD-NEXT: callq __morestack
139 ; X64-DFlyBSD-NEXT: ret
143 define i32 @test_nested(i32 * nest %closure, i32 %other) #0 {
144 %addend = load i32 * %closure
145 %result = add i32 %other, %addend
146 %mem = alloca i32, i32 10
147 call void @dummy_use (i32* %mem, i32 10)
150 ; X32-Linux: cmpl %gs:48, %esp
151 ; X32-Linux-NEXT: ja .LBB1_2
153 ; X32-Linux: pushl $4
154 ; X32-Linux-NEXT: pushl $60
155 ; X32-Linux-NEXT: calll __morestack
156 ; X32-Linux-NEXT: ret
158 ; X64-Linux: cmpq %fs:112, %rsp
159 ; X64-Linux-NEXT: ja .LBB1_2
161 ; X64-Linux: movq %r10, %rax
162 ; X64-Linux-NEXT: movabsq $56, %r10
163 ; X64-Linux-NEXT: movabsq $0, %r11
164 ; X64-Linux-NEXT: callq __morestack
165 ; X64-Linux-NEXT: ret
166 ; X64-Linux-NEXT: movq %rax, %r10
168 ; X32ABI: cmpl %fs:64, %esp
169 ; X32ABI-NEXT: ja .LBB1_2
171 ; X32ABI: movl %r10d, %eax
172 ; X32ABI-NEXT: movl $56, %r10d
173 ; X32ABI-NEXT: movl $0, %r11d
174 ; X32ABI-NEXT: callq __morestack
176 ; X32ABI-NEXT: movq %rax, %r10
178 ; X32-Darwin: movl $432, %edx
179 ; X32-Darwin-NEXT: cmpl %gs:(%edx), %esp
180 ; X32-Darwin-NEXT: ja LBB1_2
182 ; X32-Darwin: pushl $4
183 ; X32-Darwin-NEXT: pushl $60
184 ; X32-Darwin-NEXT: calll ___morestack
185 ; X32-Darwin-NEXT: ret
187 ; X64-Darwin: cmpq %gs:816, %rsp
188 ; X64-Darwin-NEXT: ja LBB1_2
190 ; X64-Darwin: movq %r10, %rax
191 ; X64-Darwin-NEXT: movabsq $56, %r10
192 ; X64-Darwin-NEXT: movabsq $0, %r11
193 ; X64-Darwin-NEXT: callq ___morestack
194 ; X64-Darwin-NEXT: ret
195 ; X64-Darwin-NEXT: movq %rax, %r10
197 ; X32-MinGW: cmpl %fs:20, %esp
198 ; X32-MinGW-NEXT: ja LBB1_2
200 ; X32-MinGW: pushl $4
201 ; X32-MinGW-NEXT: pushl $52
202 ; X32-MinGW-NEXT: calll ___morestack
203 ; X32-MinGW-NEXT: ret
205 ; X64-MinGW-LABEL: test_nested:
206 ; X64-MinGW: cmpq %gs:40, %rsp
207 ; X64-MinGW-NEXT: ja .LBB1_2
209 ; X64-MinGW: movq %r10, %rax
210 ; X64-MinGW-NEXT: movabsq $88, %r10
211 ; X64-MinGW-NEXT: movabsq $32, %r11
212 ; X64-MinGW-NEXT: callq __morestack
213 ; X64-MinGW-NEXT: retq
214 ; X64-MinGW-NEXT: movq %rax, %r10
216 ; X64-FreeBSD: cmpq %fs:24, %rsp
217 ; X64-FreeBSD-NEXT: ja .LBB1_2
219 ; X64-FreeBSD: movq %r10, %rax
220 ; X64-FreeBSD-NEXT: movabsq $56, %r10
221 ; X64-FreeBSD-NEXT: movabsq $0, %r11
222 ; X64-FreeBSD-NEXT: callq __morestack
223 ; X64-FreeBSD-NEXT: ret
224 ; X64-FreeBSD-NEXT: movq %rax, %r10
226 ; X32-DFlyBSD: cmpl %fs:16, %esp
227 ; X32-DFlyBSD-NEXT: ja .LBB1_2
229 ; X32-DFlyBSD: pushl $4
230 ; X32-DFlyBSD-NEXT: pushl $52
231 ; X32-DFlyBSD-NEXT: calll __morestack
232 ; X32-DFlyBSD-NEXT: ret
234 ; X64-DFlyBSD: cmpq %fs:32, %rsp
235 ; X64-DFlyBSD-NEXT: ja .LBB1_2
237 ; X64-DFlyBSD: movq %r10, %rax
238 ; X64-DFlyBSD-NEXT: movabsq $56, %r10
239 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
240 ; X64-DFlyBSD-NEXT: callq __morestack
241 ; X64-DFlyBSD-NEXT: ret
242 ; X64-DFlyBSD-NEXT: movq %rax, %r10
246 define void @test_large() #0 {
247 %mem = alloca i32, i32 10000
248 call void @dummy_use (i32* %mem, i32 0)
251 ; X32-Linux: leal -40012(%esp), %ecx
252 ; X32-Linux-NEXT: cmpl %gs:48, %ecx
253 ; X32-Linux-NEXT: ja .LBB2_2
255 ; X32-Linux: pushl $0
256 ; X32-Linux-NEXT: pushl $40012
257 ; X32-Linux-NEXT: calll __morestack
258 ; X32-Linux-NEXT: ret
260 ; X64-Linux: leaq -40008(%rsp), %r11
261 ; X64-Linux-NEXT: cmpq %fs:112, %r11
262 ; X64-Linux-NEXT: ja .LBB2_2
264 ; X64-Linux: movabsq $40008, %r10
265 ; X64-Linux-NEXT: movabsq $0, %r11
266 ; X64-Linux-NEXT: callq __morestack
267 ; X64-Linux-NEXT: ret
269 ; X32ABI: leal -40008(%rsp), %r11d
270 ; X32ABI-NEXT: cmpl %fs:64, %r11d
271 ; X32ABI-NEXT: ja .LBB2_2
273 ; X32ABI: movl $40008, %r10d
274 ; X32ABI-NEXT: movl $0, %r11d
275 ; X32ABI-NEXT: callq __morestack
278 ; X32-Darwin: leal -40012(%esp), %ecx
279 ; X32-Darwin-NEXT: movl $432, %eax
280 ; X32-Darwin-NEXT: cmpl %gs:(%eax), %ecx
281 ; X32-Darwin-NEXT: ja LBB2_2
283 ; X32-Darwin: pushl $0
284 ; X32-Darwin-NEXT: pushl $40012
285 ; X32-Darwin-NEXT: calll ___morestack
286 ; X32-Darwin-NEXT: ret
288 ; X64-Darwin: leaq -40008(%rsp), %r11
289 ; X64-Darwin-NEXT: cmpq %gs:816, %r11
290 ; X64-Darwin-NEXT: ja LBB2_2
292 ; X64-Darwin: movabsq $40008, %r10
293 ; X64-Darwin-NEXT: movabsq $0, %r11
294 ; X64-Darwin-NEXT: callq ___morestack
295 ; X64-Darwin-NEXT: ret
297 ; X32-MinGW: leal -40008(%esp), %ecx
298 ; X32-MinGW-NEXT: cmpl %fs:20, %ecx
299 ; X32-MinGW-NEXT: ja LBB2_2
301 ; X32-MinGW: pushl $0
302 ; X32-MinGW-NEXT: pushl $40008
303 ; X32-MinGW-NEXT: calll ___morestack
304 ; X32-MinGW-NEXT: ret
306 ; X64-MinGW-LABEL: test_large:
307 ; X64-MinGW: leaq -40040(%rsp), %r11
308 ; X64-MinGW-NEXT: cmpq %gs:40, %r11
309 ; X64-MinGW-NEXT: ja .LBB2_2
311 ; X64-MinGW: movabsq $40040, %r10
312 ; X64-MinGW-NEXT: movabsq $32, %r11
313 ; X64-MinGW-NEXT: callq __morestack
314 ; X64-MinGW-NEXT: retq
316 ; X64-FreeBSD: leaq -40008(%rsp), %r11
317 ; X64-FreeBSD-NEXT: cmpq %fs:24, %r11
318 ; X64-FreeBSD-NEXT: ja .LBB2_2
320 ; X64-FreeBSD: movabsq $40008, %r10
321 ; X64-FreeBSD-NEXT: movabsq $0, %r11
322 ; X64-FreeBSD-NEXT: callq __morestack
323 ; X64-FreeBSD-NEXT: ret
325 ; X32-DFlyBSD: leal -40008(%esp), %ecx
326 ; X32-DFlyBSD-NEXT: cmpl %fs:16, %ecx
327 ; X32-DFlyBSD-NEXT: ja .LBB2_2
329 ; X32-DFlyBSD: pushl $0
330 ; X32-DFlyBSD-NEXT: pushl $40008
331 ; X32-DFlyBSD-NEXT: calll __morestack
332 ; X32-DFlyBSD-NEXT: ret
334 ; X64-DFlyBSD: leaq -40008(%rsp), %r11
335 ; X64-DFlyBSD-NEXT: cmpq %fs:32, %r11
336 ; X64-DFlyBSD-NEXT: ja .LBB2_2
338 ; X64-DFlyBSD: movabsq $40008, %r10
339 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
340 ; X64-DFlyBSD-NEXT: callq __morestack
341 ; X64-DFlyBSD-NEXT: ret
345 define fastcc void @test_fastcc() #0 {
346 %mem = alloca i32, i32 10
347 call void @dummy_use (i32* %mem, i32 10)
350 ; X32-Linux-LABEL: test_fastcc:
352 ; X32-Linux: cmpl %gs:48, %esp
353 ; X32-Linux-NEXT: ja .LBB3_2
355 ; X32-Linux: pushl $0
356 ; X32-Linux-NEXT: pushl $60
357 ; X32-Linux-NEXT: calll __morestack
358 ; X32-Linux-NEXT: ret
360 ; X64-Linux-LABEL: test_fastcc:
362 ; X64-Linux: cmpq %fs:112, %rsp
363 ; X64-Linux-NEXT: ja .LBB3_2
365 ; X64-Linux: movabsq $40, %r10
366 ; X64-Linux-NEXT: movabsq $0, %r11
367 ; X64-Linux-NEXT: callq __morestack
368 ; X64-Linux-NEXT: ret
370 ; X32ABI-LABEL: test_fastcc:
372 ; X32ABI: cmpl %fs:64, %esp
373 ; X32ABI-NEXT: ja .LBB3_2
375 ; X32ABI: movl $40, %r10d
376 ; X32ABI-NEXT: movl $0, %r11d
377 ; X32ABI-NEXT: callq __morestack
380 ; X32-Darwin-LABEL: test_fastcc:
382 ; X32-Darwin: movl $432, %eax
383 ; X32-Darwin-NEXT: cmpl %gs:(%eax), %esp
384 ; X32-Darwin-NEXT: ja LBB3_2
386 ; X32-Darwin: pushl $0
387 ; X32-Darwin-NEXT: pushl $60
388 ; X32-Darwin-NEXT: calll ___morestack
389 ; X32-Darwin-NEXT: ret
391 ; X64-Darwin-LABEL: test_fastcc:
393 ; X64-Darwin: cmpq %gs:816, %rsp
394 ; X64-Darwin-NEXT: ja LBB3_2
396 ; X64-Darwin: movabsq $40, %r10
397 ; X64-Darwin-NEXT: movabsq $0, %r11
398 ; X64-Darwin-NEXT: callq ___morestack
399 ; X64-Darwin-NEXT: ret
401 ; X32-MinGW-LABEL: test_fastcc:
403 ; X32-MinGW: cmpl %fs:20, %esp
404 ; X32-MinGW-NEXT: ja LBB3_2
406 ; X32-MinGW: pushl $0
407 ; X32-MinGW-NEXT: pushl $48
408 ; X32-MinGW-NEXT: calll ___morestack
409 ; X32-MinGW-NEXT: ret
411 ; X64-MinGW-LABEL: test_fastcc:
413 ; X64-MinGW: cmpq %gs:40, %rsp
414 ; X64-MinGW-NEXT: ja .LBB3_2
416 ; X64-MinGW: movabsq $72, %r10
417 ; X64-MinGW-NEXT: movabsq $32, %r11
418 ; X64-MinGW-NEXT: callq __morestack
419 ; X64-MinGW-NEXT: retq
421 ; X64-FreeBSD-LABEL: test_fastcc:
423 ; X64-FreeBSD: cmpq %fs:24, %rsp
424 ; X64-FreeBSD-NEXT: ja .LBB3_2
426 ; X64-FreeBSD: movabsq $40, %r10
427 ; X64-FreeBSD-NEXT: movabsq $0, %r11
428 ; X64-FreeBSD-NEXT: callq __morestack
429 ; X64-FreeBSD-NEXT: ret
431 ; X32-DFlyBSD-LABEL: test_fastcc:
433 ; X32-DFlyBSD: cmpl %fs:16, %esp
434 ; X32-DFlyBSD-NEXT: ja .LBB3_2
436 ; X32-DFlyBSD: pushl $0
437 ; X32-DFlyBSD-NEXT: pushl $48
438 ; X32-DFlyBSD-NEXT: calll __morestack
439 ; X32-DFlyBSD-NEXT: ret
441 ; X64-DFlyBSD-LABEL: test_fastcc:
443 ; X64-DFlyBSD: cmpq %fs:32, %rsp
444 ; X64-DFlyBSD-NEXT: ja .LBB3_2
446 ; X64-DFlyBSD: movabsq $40, %r10
447 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
448 ; X64-DFlyBSD-NEXT: callq __morestack
449 ; X64-DFlyBSD-NEXT: ret
453 define fastcc void @test_fastcc_large() #0 {
454 %mem = alloca i32, i32 10000
455 call void @dummy_use (i32* %mem, i32 0)
458 ; X32-Linux-LABEL: test_fastcc_large:
460 ; X32-Linux: leal -40012(%esp), %eax
461 ; X32-Linux-NEXT: cmpl %gs:48, %eax
462 ; X32-Linux-NEXT: ja .LBB4_2
464 ; X32-Linux: pushl $0
465 ; X32-Linux-NEXT: pushl $40012
466 ; X32-Linux-NEXT: calll __morestack
467 ; X32-Linux-NEXT: ret
469 ; X64-Linux-LABEL: test_fastcc_large:
471 ; X64-Linux: leaq -40008(%rsp), %r11
472 ; X64-Linux-NEXT: cmpq %fs:112, %r11
473 ; X64-Linux-NEXT: ja .LBB4_2
475 ; X64-Linux: movabsq $40008, %r10
476 ; X64-Linux-NEXT: movabsq $0, %r11
477 ; X64-Linux-NEXT: callq __morestack
478 ; X64-Linux-NEXT: ret
480 ; X32ABI-LABEL: test_fastcc_large:
482 ; X32ABI: leal -40008(%rsp), %r11d
483 ; X32ABI-NEXT: cmpl %fs:64, %r11d
484 ; X32ABI-NEXT: ja .LBB4_2
486 ; X32ABI: movl $40008, %r10d
487 ; X32ABI-NEXT: movl $0, %r11d
488 ; X32ABI-NEXT: callq __morestack
491 ; X32-Darwin-LABEL: test_fastcc_large:
493 ; X32-Darwin: leal -40012(%esp), %eax
494 ; X32-Darwin-NEXT: movl $432, %ecx
495 ; X32-Darwin-NEXT: cmpl %gs:(%ecx), %eax
496 ; X32-Darwin-NEXT: ja LBB4_2
498 ; X32-Darwin: pushl $0
499 ; X32-Darwin-NEXT: pushl $40012
500 ; X32-Darwin-NEXT: calll ___morestack
501 ; X32-Darwin-NEXT: ret
503 ; X64-Darwin-LABEL: test_fastcc_large:
505 ; X64-Darwin: leaq -40008(%rsp), %r11
506 ; X64-Darwin-NEXT: cmpq %gs:816, %r11
507 ; X64-Darwin-NEXT: ja LBB4_2
509 ; X64-Darwin: movabsq $40008, %r10
510 ; X64-Darwin-NEXT: movabsq $0, %r11
511 ; X64-Darwin-NEXT: callq ___morestack
512 ; X64-Darwin-NEXT: ret
514 ; X32-MinGW-LABEL: test_fastcc_large:
516 ; X32-MinGW: leal -40008(%esp), %eax
517 ; X32-MinGW-NEXT: cmpl %fs:20, %eax
518 ; X32-MinGW-NEXT: ja LBB4_2
520 ; X32-MinGW: pushl $0
521 ; X32-MinGW-NEXT: pushl $40008
522 ; X32-MinGW-NEXT: calll ___morestack
523 ; X32-MinGW-NEXT: ret
525 ; X64-MinGW-LABEL: test_fastcc_large:
527 ; X64-MinGW: leaq -40040(%rsp), %r11
528 ; X64-MinGW-NEXT: cmpq %gs:40, %r11
529 ; X64-MinGW-NEXT: ja .LBB4_2
531 ; X64-MinGW: movabsq $40040, %r10
532 ; X64-MinGW-NEXT: movabsq $32, %r11
533 ; X64-MinGW-NEXT: callq __morestack
534 ; X64-MinGW-NEXT: retq
536 ; X64-FreeBSD-LABEL: test_fastcc_large:
538 ; X64-FreeBSD: leaq -40008(%rsp), %r11
539 ; X64-FreeBSD-NEXT: cmpq %fs:24, %r11
540 ; X64-FreeBSD-NEXT: ja .LBB4_2
542 ; X64-FreeBSD: movabsq $40008, %r10
543 ; X64-FreeBSD-NEXT: movabsq $0, %r11
544 ; X64-FreeBSD-NEXT: callq __morestack
545 ; X64-FreeBSD-NEXT: ret
547 ; X32-DFlyBSD-LABEL: test_fastcc_large:
549 ; X32-DFlyBSD: leal -40008(%esp), %eax
550 ; X32-DFlyBSD-NEXT: cmpl %fs:16, %eax
551 ; X32-DFlyBSD-NEXT: ja .LBB4_2
553 ; X32-DFlyBSD: pushl $0
554 ; X32-DFlyBSD-NEXT: pushl $40008
555 ; X32-DFlyBSD-NEXT: calll __morestack
556 ; X32-DFlyBSD-NEXT: ret
558 ; X64-DFlyBSD-LABEL: test_fastcc_large:
560 ; X64-DFlyBSD: leaq -40008(%rsp), %r11
561 ; X64-DFlyBSD-NEXT: cmpq %fs:32, %r11
562 ; X64-DFlyBSD-NEXT: ja .LBB4_2
564 ; X64-DFlyBSD: movabsq $40008, %r10
565 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
566 ; X64-DFlyBSD-NEXT: callq __morestack
567 ; X64-DFlyBSD-NEXT: ret
571 define fastcc void @test_fastcc_large_with_ecx_arg(i32 %a) #0 {
572 %mem = alloca i32, i32 10000
573 call void @dummy_use (i32* %mem, i32 %a)
576 ; This is testing that the Mac implementation preserves ecx
578 ; X32-Darwin-LABEL: test_fastcc_large_with_ecx_arg:
580 ; X32-Darwin: leal -40012(%esp), %eax
581 ; X32-Darwin-NEXT: pushl %ecx
582 ; X32-Darwin-NEXT: movl $432, %ecx
583 ; X32-Darwin-NEXT: cmpl %gs:(%ecx), %eax
584 ; X32-Darwin-NEXT: popl %ecx
585 ; X32-Darwin-NEXT: ja LBB5_2
587 ; X32-Darwin: pushl $0
588 ; X32-Darwin-NEXT: pushl $40012
589 ; X32-Darwin-NEXT: calll ___morestack
590 ; X32-Darwin-NEXT: ret
594 define void @test_nostack() #0 {
597 ; X32-Linux-LABEL: test_nostack:
598 ; X32-Linux-NOT: calll __morestack
600 ; X64-Linux-LABEL: test_nostack:
601 ; X32-Linux-NOT: callq __morestack
603 ; X32ABI-LABEL: test_nostack:
604 ; X32ABI-NOT: callq __morestack
606 ; X32-Darwin-LABEL: test_nostack:
607 ; X32-Darwin-NOT: calll __morestack
609 ; X64-Darwin-LABEL: test_nostack:
610 ; X64-Darwin-NOT: callq __morestack
612 ; X32-MinGW-LABEL: test_nostack:
613 ; X32-MinGW-NOT: calll __morestack
615 ; X64-MinGW-LABEL: test_nostack:
616 ; X64-MinGW-NOT: callq __morestack
618 ; X64-FreeBSD-LABEL: test_nostack:
619 ; X64-FreeBSD-NOT: callq __morestack
621 ; X32-DFlyBSD-LABEL: test_nostack:
622 ; X32-DFlyBSD-NOT: calll __morestack
624 ; X64-DFlyBSD-LABEL: test_nostack:
625 ; X64-DFlyBSD-NOT: callq __morestack
628 attributes #0 = { "split-stack" }