blob: d0915e244eeb62088b75bc7d6083377a7dd6d735 [file] [log] [blame]
Derek Schuff1804b572013-06-14 16:15:29 +00001; 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
8declare void @llvm.eh.unwind.init()
9
10define void @calls_unwind_init() {
11 call void @llvm.eh.unwind.init()
12 ret void
13}
14
Stephen Lind24ab202013-07-14 06:24:09 +000015; X8664-LABEL: calls_unwind_init:
Derek Schuff1804b572013-06-14 16:15:29 +000016; 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 Lind24ab202013-07-14 06:24:09 +000028; X8632-LABEL: calls_unwind_init:
Derek Schuff1804b572013-06-14 16:15:29 +000029; 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