Derek Schuff | 1804b57 | 2013-06-14 16:15:29 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-unknown-linux < %s | FileCheck -check-prefix X8664 %s |
| 2 | ; RUN: llc -mtriple=i686-unknown-linux < %s | FileCheck -check-prefix X8632 %s |
| 3 | ; Check that all callee-saved registers are saved and restored in functions |
| 4 | ; that call __builtin_unwind_init(). This is its undocumented behavior in gcc, |
| 5 | ; and it is used in compiling libgcc_eh. |
| 6 | ; See also PR8541 |
| 7 | |
| 8 | declare void @llvm.eh.unwind.init() |
| 9 | |
| 10 | define void @calls_unwind_init() { |
| 11 | call void @llvm.eh.unwind.init() |
| 12 | ret void |
| 13 | } |
| 14 | |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 15 | ; X8664-LABEL: calls_unwind_init: |
Derek Schuff | 1804b57 | 2013-06-14 16:15:29 +0000 | [diff] [blame] | 16 | ; X8664: pushq %rbp |
| 17 | ; X8664: pushq %r15 |
| 18 | ; X8664: pushq %r14 |
| 19 | ; X8664: pushq %r13 |
| 20 | ; X8664: pushq %r12 |
| 21 | ; X8664: pushq %rbx |
| 22 | ; X8664: popq %rbx |
| 23 | ; X8664: popq %r12 |
| 24 | ; X8664: popq %r13 |
| 25 | ; X8664: popq %r14 |
| 26 | ; X8664: popq %r15 |
| 27 | |
Stephen Lin | d24ab20 | 2013-07-14 06:24:09 +0000 | [diff] [blame] | 28 | ; X8632-LABEL: calls_unwind_init: |
Derek Schuff | 1804b57 | 2013-06-14 16:15:29 +0000 | [diff] [blame] | 29 | ; X8632: pushl %ebp |
| 30 | ; X8632: pushl %ebx |
| 31 | ; X8632: pushl %edi |
| 32 | ; X8632: pushl %esi |
| 33 | ; X8632: popl %esi |
| 34 | ; X8632: popl %edi |
| 35 | ; X8632: popl %ebx |
| 36 | ; X8632: popl %ebp |