1 ; RUN: llc < %s -tailcallopt -mtriple=i686-linux-gnu | FileCheck %s
3 ; Test the GHC call convention works (x86-32)
5 @base = external global i32 ; assigned to register: EBX
6 @sp = external global i32 ; assigned to register: EBP
7 @hp = external global i32 ; assigned to register: EDI
8 @r1 = external global i32 ; assigned to register: ESI
10 define void @zap(i32 %a, i32 %b) nounwind {
12 ; CHECK: movl {{[0-9]*}}(%esp), %ebx
13 ; CHECK-NEXT: movl {{[0-9]*}}(%esp), %ebp
14 ; CHECK-NEXT: calll addtwo
15 %0 = call cc 10 i32 @addtwo(i32 %a, i32 %b)
17 call void @foo() nounwind
21 define cc 10 i32 @addtwo(i32 %x, i32 %y) nounwind {
23 ; CHECK: leal (%ebx,%ebp), %eax
29 define cc 10 void @foo() nounwind {
31 ; CHECK: movl base, %ebx
32 ; CHECK-NEXT: movl sp, %ebp
33 ; CHECK-NEXT: movl hp, %edi
34 ; CHECK-NEXT: movl r1, %esi
40 tail call cc 10 void @bar( i32 %3, i32 %2, i32 %1, i32 %0 ) nounwind
44 declare cc 10 void @bar(i32, i32, i32, i32)