1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mcpu=corei7 < %s -verify-machineinstrs | FileCheck %s
4 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64"
5 target triple = "i386-pc-linux"
7 ; Check that eh_return & unwind_init were properly lowered
9 define ptr @test1(i32 %a, ptr %b) nounwind {
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: pushl %ebp
13 ; CHECK-NEXT: movl %esp, %ebp
14 ; CHECK-NEXT: pushl %ebx
15 ; CHECK-NEXT: pushl %edi
16 ; CHECK-NEXT: pushl %esi
17 ; CHECK-NEXT: pushl %edx
18 ; CHECK-NEXT: pushl %eax
19 ; CHECK-NEXT: pushl %eax
20 ; CHECK-NEXT: movl 12(%ebp), %ecx
21 ; CHECK-NEXT: movl 8(%ebp), %eax
22 ; CHECK-NEXT: movl %ecx, 4(%ebp,%eax)
23 ; CHECK-NEXT: leal 4(%ebp,%eax), %ecx
24 ; CHECK-NEXT: addl $4, %esp
25 ; CHECK-NEXT: popl %eax
26 ; CHECK-NEXT: popl %edx
27 ; CHECK-NEXT: popl %esi
28 ; CHECK-NEXT: popl %edi
29 ; CHECK-NEXT: popl %ebx
30 ; CHECK-NEXT: popl %ebp
31 ; CHECK-NEXT: movl %ecx, %esp
32 ; CHECK-NEXT: retl # eh_return, addr: %ecx
34 call void @llvm.eh.unwind.init()
36 call void @llvm.eh.return.i32(i32 %a, ptr %b)
40 define ptr @test2(i32 %a, ptr %b) nounwind {
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: pushl %ebp
44 ; CHECK-NEXT: movl %esp, %ebp
45 ; CHECK-NEXT: pushl %eax
46 ; CHECK-NEXT: movl 12(%ebp), %ecx
47 ; CHECK-NEXT: movl 8(%ebp), %eax
48 ; CHECK-NEXT: movl %ecx, 4(%ebp,%eax)
49 ; CHECK-NEXT: leal 4(%ebp,%eax), %ecx
50 ; CHECK-NEXT: popl %eax
51 ; CHECK-NEXT: popl %ebp
52 ; CHECK-NEXT: movl %ecx, %esp
53 ; CHECK-NEXT: retl # eh_return, addr: %ecx
55 call void @llvm.eh.return.i32(i32 %a, ptr %b)
59 declare void @llvm.eh.return.i32(i32, ptr)
60 declare void @llvm.eh.unwind.init()