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 -code-model=large -verify-machineinstrs | FileCheck %s -check-prefix=X64-Linux-Large
4 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -verify-machineinstrs | FileCheck %s -check-prefix=X32ABI
5 ; RUN: llc < %s -mcpu=generic -mtriple=i686-darwin -verify-machineinstrs | FileCheck %s -check-prefix=X32-Darwin
6 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -verify-machineinstrs | FileCheck %s -check-prefix=X64-Darwin
7 ; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -verify-machineinstrs | FileCheck %s -check-prefix=X32-MinGW
8 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -verify-machineinstrs | FileCheck %s -check-prefix=X64-FreeBSD
9 ; RUN: llc < %s -mcpu=generic -mtriple=i686-dragonfly -verify-machineinstrs | FileCheck %s -check-prefix=X32-DFlyBSD
10 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-dragonfly -verify-machineinstrs | FileCheck %s -check-prefix=X64-DFlyBSD
11 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -verify-machineinstrs | FileCheck %s -check-prefix=X64-MinGW
13 ; We used to crash with filetype=obj
14 ; RUN: llc < %s -mcpu=generic -mtriple=i686-linux -filetype=obj -o /dev/null
15 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux -filetype=obj -o /dev/null
16 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-linux-gnux32 -filetype=obj -o /dev/null
17 ; RUN: llc < %s -mcpu=generic -mtriple=i686-darwin -filetype=obj -o /dev/null
18 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-darwin -filetype=obj -o /dev/null
19 ; RUN: llc < %s -mcpu=generic -mtriple=i686-mingw32 -filetype=obj -o /dev/null
20 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-freebsd -filetype=obj -o /dev/null
21 ; RUN: llc < %s -mcpu=generic -mtriple=i686-dragonfly -filetype=obj -o /dev/null
22 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-dragonfly -filetype=obj -o /dev/null
23 ; RUN: llc < %s -mcpu=generic -mtriple=x86_64-mingw32 -filetype=obj -o /dev/null
25 ; RUN: not llc < %s -mcpu=generic -mtriple=x86_64-solaris 2> %t.log
26 ; RUN: FileCheck %s -input-file=%t.log -check-prefix=X64-Solaris
27 ; RUN: not llc < %s -mcpu=generic -mtriple=i686-freebsd 2> %t.log
28 ; RUN: FileCheck %s -input-file=%t.log -check-prefix=X32-FreeBSD
30 ; X64-Solaris: Segmented stacks not supported on this platform
31 ; X32-FreeBSD: Segmented stacks not supported on FreeBSD i386
33 ; Just to prevent the alloca from being optimized away
34 declare void @dummy_use(i32*, i32)
36 define void @test_basic() #0 {
37 %mem = alloca i32, i32 10
38 call void @dummy_use (i32* %mem, i32 10)
41 ; X32-Linux-LABEL: test_basic:
43 ; X32-Linux: cmpl %gs:48, %esp
44 ; X32-Linux-NEXT: ja .LBB0_2
47 ; X32-Linux-NEXT: pushl $60
48 ; X32-Linux-NEXT: calll __morestack
51 ; X64-Linux-LABEL: test_basic:
53 ; X64-Linux: cmpq %fs:112, %rsp
54 ; X64-Linux-NEXT: ja .LBB0_2
56 ; X64-Linux: movabsq $40, %r10
57 ; X64-Linux-NEXT: movabsq $0, %r11
58 ; X64-Linux-NEXT: callq __morestack
61 ; X64-Linux-Large-LABEL: test_basic:
63 ; X64-Linux-Large: cmpq %fs:112, %rsp
64 ; X64-Linux-Large-NEXT: ja .LBB0_2
66 ; X64-Linux-Large: movabsq $40, %r10
67 ; X64-Linux-Large-NEXT: movabsq $0, %r11
68 ; X64-Linux-Large-NEXT: callq *__morestack_addr(%rip)
69 ; X64-Linux-Large-NEXT: ret
71 ; X32ABI-LABEL: test_basic:
73 ; X32ABI: cmpl %fs:64, %esp
74 ; X32ABI-NEXT: ja .LBB0_2
76 ; X32ABI: movl $40, %r10d
77 ; X32ABI-NEXT: movl $0, %r11d
78 ; X32ABI-NEXT: callq __morestack
81 ; X32-Darwin-LABEL: test_basic:
83 ; X32-Darwin: movl $432, %ecx
84 ; X32-Darwin-NEXT: cmpl %gs:(%ecx), %esp
85 ; X32-Darwin-NEXT: ja LBB0_2
87 ; X32-Darwin: pushl $0
88 ; X32-Darwin-NEXT: pushl $60
89 ; X32-Darwin-NEXT: calll ___morestack
90 ; X32-Darwin-NEXT: ret
92 ; X64-Darwin-LABEL: test_basic:
94 ; X64-Darwin: cmpq %gs:816, %rsp
95 ; X64-Darwin-NEXT: ja LBB0_2
97 ; X64-Darwin: movabsq $40, %r10
98 ; X64-Darwin-NEXT: movabsq $0, %r11
99 ; X64-Darwin-NEXT: callq ___morestack
100 ; X64-Darwin-NEXT: ret
102 ; X32-MinGW-LABEL: test_basic:
104 ; X32-MinGW: cmpl %fs:20, %esp
105 ; X32-MinGW-NEXT: ja LBB0_2
107 ; X32-MinGW: pushl $0
108 ; X32-MinGW-NEXT: pushl $48
109 ; X32-MinGW-NEXT: calll ___morestack
110 ; X32-MinGW-NEXT: ret
112 ; X64-MinGW-LABEL: test_basic:
114 ; X64-MinGW: cmpq %gs:40, %rsp
115 ; X64-MinGW-NEXT: ja .LBB0_2
117 ; X64-MinGW: movabsq $72, %r10
118 ; X64-MinGW-NEXT: movabsq $32, %r11
119 ; X64-MinGW-NEXT: callq __morestack
120 ; X64-MinGW-NEXT: retq
122 ; X64-FreeBSD-LABEL: test_basic:
124 ; X64-FreeBSD: cmpq %fs:24, %rsp
125 ; X64-FreeBSD-NEXT: ja .LBB0_2
127 ; X64-FreeBSD: movabsq $40, %r10
128 ; X64-FreeBSD-NEXT: movabsq $0, %r11
129 ; X64-FreeBSD-NEXT: callq __morestack
130 ; X64-FreeBSD-NEXT: ret
132 ; X32-DFlyBSD-LABEL: test_basic:
134 ; X32-DFlyBSD: cmpl %fs:16, %esp
135 ; X32-DFlyBSD-NEXT: ja .LBB0_2
137 ; X32-DFlyBSD: pushl $0
138 ; X32-DFlyBSD-NEXT: pushl $48
139 ; X32-DFlyBSD-NEXT: calll __morestack
140 ; X32-DFlyBSD-NEXT: ret
142 ; X64-DFlyBSD-LABEL: test_basic:
144 ; X64-DFlyBSD: cmpq %fs:32, %rsp
145 ; X64-DFlyBSD-NEXT: ja .LBB0_2
147 ; X64-DFlyBSD: movabsq $40, %r10
148 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
149 ; X64-DFlyBSD-NEXT: callq __morestack
150 ; X64-DFlyBSD-NEXT: ret
154 define i32 @test_nested(i32 * nest %closure, i32 %other) #0 {
155 %addend = load i32 , i32 * %closure
156 %result = add i32 %other, %addend
157 %mem = alloca i32, i32 10
158 call void @dummy_use (i32* %mem, i32 10)
161 ; X32-Linux: cmpl %gs:48, %esp
162 ; X32-Linux-NEXT: ja .LBB1_2
164 ; X32-Linux: pushl $4
165 ; X32-Linux-NEXT: pushl $60
166 ; X32-Linux-NEXT: calll __morestack
167 ; X32-Linux-NEXT: ret
169 ; X64-Linux: cmpq %fs:112, %rsp
170 ; X64-Linux-NEXT: ja .LBB1_2
172 ; X64-Linux: movq %r10, %rax
173 ; X64-Linux-NEXT: movabsq $56, %r10
174 ; X64-Linux-NEXT: movabsq $0, %r11
175 ; X64-Linux-NEXT: callq __morestack
176 ; X64-Linux-NEXT: ret
177 ; X64-Linux-NEXT: movq %rax, %r10
179 ; X32ABI: cmpl %fs:64, %esp
180 ; X32ABI-NEXT: ja .LBB1_2
182 ; X32ABI: movl %r10d, %eax
183 ; X32ABI-NEXT: movl $56, %r10d
184 ; X32ABI-NEXT: movl $0, %r11d
185 ; X32ABI-NEXT: callq __morestack
187 ; X32ABI-NEXT: movq %rax, %r10
189 ; X32-Darwin: movl $432, %edx
190 ; X32-Darwin-NEXT: cmpl %gs:(%edx), %esp
191 ; X32-Darwin-NEXT: ja LBB1_2
193 ; X32-Darwin: pushl $4
194 ; X32-Darwin-NEXT: pushl $60
195 ; X32-Darwin-NEXT: calll ___morestack
196 ; X32-Darwin-NEXT: ret
198 ; X64-Darwin: cmpq %gs:816, %rsp
199 ; X64-Darwin-NEXT: ja LBB1_2
201 ; X64-Darwin: movq %r10, %rax
202 ; X64-Darwin-NEXT: movabsq $56, %r10
203 ; X64-Darwin-NEXT: movabsq $0, %r11
204 ; X64-Darwin-NEXT: callq ___morestack
205 ; X64-Darwin-NEXT: ret
206 ; X64-Darwin-NEXT: movq %rax, %r10
208 ; X32-MinGW: cmpl %fs:20, %esp
209 ; X32-MinGW-NEXT: ja LBB1_2
211 ; X32-MinGW: pushl $4
212 ; X32-MinGW-NEXT: pushl $52
213 ; X32-MinGW-NEXT: calll ___morestack
214 ; X32-MinGW-NEXT: ret
216 ; X64-MinGW-LABEL: test_nested:
217 ; X64-MinGW: cmpq %gs:40, %rsp
218 ; X64-MinGW-NEXT: ja .LBB1_2
220 ; X64-MinGW: movq %r10, %rax
221 ; X64-MinGW-NEXT: movabsq $88, %r10
222 ; X64-MinGW-NEXT: movabsq $32, %r11
223 ; X64-MinGW-NEXT: callq __morestack
224 ; X64-MinGW-NEXT: retq
225 ; X64-MinGW-NEXT: movq %rax, %r10
227 ; X64-FreeBSD: cmpq %fs:24, %rsp
228 ; X64-FreeBSD-NEXT: ja .LBB1_2
230 ; X64-FreeBSD: movq %r10, %rax
231 ; X64-FreeBSD-NEXT: movabsq $56, %r10
232 ; X64-FreeBSD-NEXT: movabsq $0, %r11
233 ; X64-FreeBSD-NEXT: callq __morestack
234 ; X64-FreeBSD-NEXT: ret
235 ; X64-FreeBSD-NEXT: movq %rax, %r10
237 ; X32-DFlyBSD: cmpl %fs:16, %esp
238 ; X32-DFlyBSD-NEXT: ja .LBB1_2
240 ; X32-DFlyBSD: pushl $4
241 ; X32-DFlyBSD-NEXT: pushl $52
242 ; X32-DFlyBSD-NEXT: calll __morestack
243 ; X32-DFlyBSD-NEXT: ret
245 ; X64-DFlyBSD: cmpq %fs:32, %rsp
246 ; X64-DFlyBSD-NEXT: ja .LBB1_2
248 ; X64-DFlyBSD: movq %r10, %rax
249 ; X64-DFlyBSD-NEXT: movabsq $56, %r10
250 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
251 ; X64-DFlyBSD-NEXT: callq __morestack
252 ; X64-DFlyBSD-NEXT: ret
253 ; X64-DFlyBSD-NEXT: movq %rax, %r10
257 define void @test_large() #0 {
258 %mem = alloca i32, i32 10000
259 call void @dummy_use (i32* %mem, i32 0)
262 ; X32-Linux: leal -40012(%esp), %ecx
263 ; X32-Linux-NEXT: cmpl %gs:48, %ecx
264 ; X32-Linux-NEXT: ja .LBB2_2
266 ; X32-Linux: pushl $0
267 ; X32-Linux-NEXT: pushl $40012
268 ; X32-Linux-NEXT: calll __morestack
269 ; X32-Linux-NEXT: ret
271 ; X64-Linux: leaq -40008(%rsp), %r11
272 ; X64-Linux-NEXT: cmpq %fs:112, %r11
273 ; X64-Linux-NEXT: ja .LBB2_2
275 ; X64-Linux: movabsq $40008, %r10
276 ; X64-Linux-NEXT: movabsq $0, %r11
277 ; X64-Linux-NEXT: callq __morestack
278 ; X64-Linux-NEXT: ret
280 ; X32ABI: leal -40008(%rsp), %r11d
281 ; X32ABI-NEXT: cmpl %fs:64, %r11d
282 ; X32ABI-NEXT: ja .LBB2_2
284 ; X32ABI: movl $40008, %r10d
285 ; X32ABI-NEXT: movl $0, %r11d
286 ; X32ABI-NEXT: callq __morestack
289 ; X32-Darwin: leal -40012(%esp), %ecx
290 ; X32-Darwin-NEXT: movl $432, %eax
291 ; X32-Darwin-NEXT: cmpl %gs:(%eax), %ecx
292 ; X32-Darwin-NEXT: ja LBB2_2
294 ; X32-Darwin: pushl $0
295 ; X32-Darwin-NEXT: pushl $40012
296 ; X32-Darwin-NEXT: calll ___morestack
297 ; X32-Darwin-NEXT: ret
299 ; X64-Darwin: leaq -40008(%rsp), %r11
300 ; X64-Darwin-NEXT: cmpq %gs:816, %r11
301 ; X64-Darwin-NEXT: ja LBB2_2
303 ; X64-Darwin: movabsq $40008, %r10
304 ; X64-Darwin-NEXT: movabsq $0, %r11
305 ; X64-Darwin-NEXT: callq ___morestack
306 ; X64-Darwin-NEXT: ret
308 ; X32-MinGW: leal -40008(%esp), %ecx
309 ; X32-MinGW-NEXT: cmpl %fs:20, %ecx
310 ; X32-MinGW-NEXT: ja LBB2_2
312 ; X32-MinGW: pushl $0
313 ; X32-MinGW-NEXT: pushl $40008
314 ; X32-MinGW-NEXT: calll ___morestack
315 ; X32-MinGW-NEXT: ret
317 ; X64-MinGW-LABEL: test_large:
318 ; X64-MinGW: leaq -40040(%rsp), %r11
319 ; X64-MinGW-NEXT: cmpq %gs:40, %r11
320 ; X64-MinGW-NEXT: ja .LBB2_2
322 ; X64-MinGW: movabsq $40040, %r10
323 ; X64-MinGW-NEXT: movabsq $32, %r11
324 ; X64-MinGW-NEXT: callq __morestack
325 ; X64-MinGW-NEXT: retq
327 ; X64-FreeBSD: leaq -40008(%rsp), %r11
328 ; X64-FreeBSD-NEXT: cmpq %fs:24, %r11
329 ; X64-FreeBSD-NEXT: ja .LBB2_2
331 ; X64-FreeBSD: movabsq $40008, %r10
332 ; X64-FreeBSD-NEXT: movabsq $0, %r11
333 ; X64-FreeBSD-NEXT: callq __morestack
334 ; X64-FreeBSD-NEXT: ret
336 ; X32-DFlyBSD: leal -40008(%esp), %ecx
337 ; X32-DFlyBSD-NEXT: cmpl %fs:16, %ecx
338 ; X32-DFlyBSD-NEXT: ja .LBB2_2
340 ; X32-DFlyBSD: pushl $0
341 ; X32-DFlyBSD-NEXT: pushl $40008
342 ; X32-DFlyBSD-NEXT: calll __morestack
343 ; X32-DFlyBSD-NEXT: ret
345 ; X64-DFlyBSD: leaq -40008(%rsp), %r11
346 ; X64-DFlyBSD-NEXT: cmpq %fs:32, %r11
347 ; X64-DFlyBSD-NEXT: ja .LBB2_2
349 ; X64-DFlyBSD: movabsq $40008, %r10
350 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
351 ; X64-DFlyBSD-NEXT: callq __morestack
352 ; X64-DFlyBSD-NEXT: ret
356 define fastcc void @test_fastcc() #0 {
357 %mem = alloca i32, i32 10
358 call void @dummy_use (i32* %mem, i32 10)
361 ; X32-Linux-LABEL: test_fastcc:
363 ; X32-Linux: cmpl %gs:48, %esp
364 ; X32-Linux-NEXT: ja .LBB3_2
366 ; X32-Linux: pushl $0
367 ; X32-Linux-NEXT: pushl $60
368 ; X32-Linux-NEXT: calll __morestack
369 ; X32-Linux-NEXT: ret
371 ; X64-Linux-LABEL: test_fastcc:
373 ; X64-Linux: cmpq %fs:112, %rsp
374 ; X64-Linux-NEXT: ja .LBB3_2
376 ; X64-Linux: movabsq $40, %r10
377 ; X64-Linux-NEXT: movabsq $0, %r11
378 ; X64-Linux-NEXT: callq __morestack
379 ; X64-Linux-NEXT: ret
381 ; X32ABI-LABEL: test_fastcc:
383 ; X32ABI: cmpl %fs:64, %esp
384 ; X32ABI-NEXT: ja .LBB3_2
386 ; X32ABI: movl $40, %r10d
387 ; X32ABI-NEXT: movl $0, %r11d
388 ; X32ABI-NEXT: callq __morestack
391 ; X32-Darwin-LABEL: test_fastcc:
393 ; X32-Darwin: movl $432, %eax
394 ; X32-Darwin-NEXT: cmpl %gs:(%eax), %esp
395 ; X32-Darwin-NEXT: ja LBB3_2
397 ; X32-Darwin: pushl $0
398 ; X32-Darwin-NEXT: pushl $60
399 ; X32-Darwin-NEXT: calll ___morestack
400 ; X32-Darwin-NEXT: ret
402 ; X64-Darwin-LABEL: test_fastcc:
404 ; X64-Darwin: cmpq %gs:816, %rsp
405 ; X64-Darwin-NEXT: ja LBB3_2
407 ; X64-Darwin: movabsq $40, %r10
408 ; X64-Darwin-NEXT: movabsq $0, %r11
409 ; X64-Darwin-NEXT: callq ___morestack
410 ; X64-Darwin-NEXT: ret
412 ; X32-MinGW-LABEL: test_fastcc:
414 ; X32-MinGW: cmpl %fs:20, %esp
415 ; X32-MinGW-NEXT: ja LBB3_2
417 ; X32-MinGW: pushl $0
418 ; X32-MinGW-NEXT: pushl $48
419 ; X32-MinGW-NEXT: calll ___morestack
420 ; X32-MinGW-NEXT: ret
422 ; X64-MinGW-LABEL: test_fastcc:
424 ; X64-MinGW: cmpq %gs:40, %rsp
425 ; X64-MinGW-NEXT: ja .LBB3_2
427 ; X64-MinGW: movabsq $72, %r10
428 ; X64-MinGW-NEXT: movabsq $32, %r11
429 ; X64-MinGW-NEXT: callq __morestack
430 ; X64-MinGW-NEXT: retq
432 ; X64-FreeBSD-LABEL: test_fastcc:
434 ; X64-FreeBSD: cmpq %fs:24, %rsp
435 ; X64-FreeBSD-NEXT: ja .LBB3_2
437 ; X64-FreeBSD: movabsq $40, %r10
438 ; X64-FreeBSD-NEXT: movabsq $0, %r11
439 ; X64-FreeBSD-NEXT: callq __morestack
440 ; X64-FreeBSD-NEXT: ret
442 ; X32-DFlyBSD-LABEL: test_fastcc:
444 ; X32-DFlyBSD: cmpl %fs:16, %esp
445 ; X32-DFlyBSD-NEXT: ja .LBB3_2
447 ; X32-DFlyBSD: pushl $0
448 ; X32-DFlyBSD-NEXT: pushl $48
449 ; X32-DFlyBSD-NEXT: calll __morestack
450 ; X32-DFlyBSD-NEXT: ret
452 ; X64-DFlyBSD-LABEL: test_fastcc:
454 ; X64-DFlyBSD: cmpq %fs:32, %rsp
455 ; X64-DFlyBSD-NEXT: ja .LBB3_2
457 ; X64-DFlyBSD: movabsq $40, %r10
458 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
459 ; X64-DFlyBSD-NEXT: callq __morestack
460 ; X64-DFlyBSD-NEXT: ret
464 define fastcc void @test_fastcc_large() #0 {
465 %mem = alloca i32, i32 10000
466 call void @dummy_use (i32* %mem, i32 0)
469 ; X32-Linux-LABEL: test_fastcc_large:
471 ; X32-Linux: leal -40012(%esp), %eax
472 ; X32-Linux-NEXT: cmpl %gs:48, %eax
473 ; X32-Linux-NEXT: ja .LBB4_2
475 ; X32-Linux: pushl $0
476 ; X32-Linux-NEXT: pushl $40012
477 ; X32-Linux-NEXT: calll __morestack
478 ; X32-Linux-NEXT: ret
480 ; X64-Linux-LABEL: test_fastcc_large:
482 ; X64-Linux: leaq -40008(%rsp), %r11
483 ; X64-Linux-NEXT: cmpq %fs:112, %r11
484 ; X64-Linux-NEXT: ja .LBB4_2
486 ; X64-Linux: movabsq $40008, %r10
487 ; X64-Linux-NEXT: movabsq $0, %r11
488 ; X64-Linux-NEXT: callq __morestack
489 ; X64-Linux-NEXT: ret
491 ; X32ABI-LABEL: test_fastcc_large:
493 ; X32ABI: leal -40008(%rsp), %r11d
494 ; X32ABI-NEXT: cmpl %fs:64, %r11d
495 ; X32ABI-NEXT: ja .LBB4_2
497 ; X32ABI: movl $40008, %r10d
498 ; X32ABI-NEXT: movl $0, %r11d
499 ; X32ABI-NEXT: callq __morestack
502 ; X32-Darwin-LABEL: test_fastcc_large:
504 ; X32-Darwin: leal -40012(%esp), %eax
505 ; X32-Darwin-NEXT: movl $432, %ecx
506 ; X32-Darwin-NEXT: cmpl %gs:(%ecx), %eax
507 ; X32-Darwin-NEXT: ja LBB4_2
509 ; X32-Darwin: pushl $0
510 ; X32-Darwin-NEXT: pushl $40012
511 ; X32-Darwin-NEXT: calll ___morestack
512 ; X32-Darwin-NEXT: ret
514 ; X64-Darwin-LABEL: test_fastcc_large:
516 ; X64-Darwin: leaq -40008(%rsp), %r11
517 ; X64-Darwin-NEXT: cmpq %gs:816, %r11
518 ; X64-Darwin-NEXT: ja LBB4_2
520 ; X64-Darwin: movabsq $40008, %r10
521 ; X64-Darwin-NEXT: movabsq $0, %r11
522 ; X64-Darwin-NEXT: callq ___morestack
523 ; X64-Darwin-NEXT: ret
525 ; X32-MinGW-LABEL: test_fastcc_large:
527 ; X32-MinGW: leal -40008(%esp), %eax
528 ; X32-MinGW-NEXT: cmpl %fs:20, %eax
529 ; X32-MinGW-NEXT: ja LBB4_2
531 ; X32-MinGW: pushl $0
532 ; X32-MinGW-NEXT: pushl $40008
533 ; X32-MinGW-NEXT: calll ___morestack
534 ; X32-MinGW-NEXT: ret
536 ; X64-MinGW-LABEL: test_fastcc_large:
538 ; X64-MinGW: leaq -40040(%rsp), %r11
539 ; X64-MinGW-NEXT: cmpq %gs:40, %r11
540 ; X64-MinGW-NEXT: ja .LBB4_2
542 ; X64-MinGW: movabsq $40040, %r10
543 ; X64-MinGW-NEXT: movabsq $32, %r11
544 ; X64-MinGW-NEXT: callq __morestack
545 ; X64-MinGW-NEXT: retq
547 ; X64-FreeBSD-LABEL: test_fastcc_large:
549 ; X64-FreeBSD: leaq -40008(%rsp), %r11
550 ; X64-FreeBSD-NEXT: cmpq %fs:24, %r11
551 ; X64-FreeBSD-NEXT: ja .LBB4_2
553 ; X64-FreeBSD: movabsq $40008, %r10
554 ; X64-FreeBSD-NEXT: movabsq $0, %r11
555 ; X64-FreeBSD-NEXT: callq __morestack
556 ; X64-FreeBSD-NEXT: ret
558 ; X32-DFlyBSD-LABEL: test_fastcc_large:
560 ; X32-DFlyBSD: leal -40008(%esp), %eax
561 ; X32-DFlyBSD-NEXT: cmpl %fs:16, %eax
562 ; X32-DFlyBSD-NEXT: ja .LBB4_2
564 ; X32-DFlyBSD: pushl $0
565 ; X32-DFlyBSD-NEXT: pushl $40008
566 ; X32-DFlyBSD-NEXT: calll __morestack
567 ; X32-DFlyBSD-NEXT: ret
569 ; X64-DFlyBSD-LABEL: test_fastcc_large:
571 ; X64-DFlyBSD: leaq -40008(%rsp), %r11
572 ; X64-DFlyBSD-NEXT: cmpq %fs:32, %r11
573 ; X64-DFlyBSD-NEXT: ja .LBB4_2
575 ; X64-DFlyBSD: movabsq $40008, %r10
576 ; X64-DFlyBSD-NEXT: movabsq $0, %r11
577 ; X64-DFlyBSD-NEXT: callq __morestack
578 ; X64-DFlyBSD-NEXT: ret
582 define fastcc void @test_fastcc_large_with_ecx_arg(i32 %a) #0 {
583 %mem = alloca i32, i32 10000
584 call void @dummy_use (i32* %mem, i32 %a)
587 ; This is testing that the Mac implementation preserves ecx
589 ; X32-Darwin-LABEL: test_fastcc_large_with_ecx_arg:
591 ; X32-Darwin: leal -40012(%esp), %eax
592 ; X32-Darwin-NEXT: pushl %ecx
593 ; X32-Darwin-NEXT: movl $432, %ecx
594 ; X32-Darwin-NEXT: cmpl %gs:(%ecx), %eax
595 ; X32-Darwin-NEXT: popl %ecx
596 ; X32-Darwin-NEXT: ja LBB5_2
598 ; X32-Darwin: pushl $0
599 ; X32-Darwin-NEXT: pushl $40012
600 ; X32-Darwin-NEXT: calll ___morestack
601 ; X32-Darwin-NEXT: ret
605 define void @test_nostack() #0 {
608 ; X32-Linux-LABEL: test_nostack:
609 ; X32-Linux-NOT: calll __morestack
611 ; X64-Linux-LABEL: test_nostack:
612 ; X32-Linux-NOT: callq __morestack
614 ; X32ABI-LABEL: test_nostack:
615 ; X32ABI-NOT: callq __morestack
617 ; X32-Darwin-LABEL: test_nostack:
618 ; X32-Darwin-NOT: calll __morestack
620 ; X64-Darwin-LABEL: test_nostack:
621 ; X64-Darwin-NOT: callq __morestack
623 ; X32-MinGW-LABEL: test_nostack:
624 ; X32-MinGW-NOT: calll __morestack
626 ; X64-MinGW-LABEL: test_nostack:
627 ; X64-MinGW-NOT: callq __morestack
629 ; X64-FreeBSD-LABEL: test_nostack:
630 ; X64-FreeBSD-NOT: callq __morestack
632 ; X32-DFlyBSD-LABEL: test_nostack:
633 ; X32-DFlyBSD-NOT: calll __morestack
635 ; X64-DFlyBSD-LABEL: test_nostack:
636 ; X64-DFlyBSD-NOT: callq __morestack
639 attributes #0 = { "split-stack" }
641 ; X64-Linux-Large: .rodata
642 ; X64-Linux-Large-NEXT: __morestack_addr:
643 ; X64-Linux-Large-NEXT: .quad __morestack