1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s -check-prefix=X32
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s -check-prefix=X64
5 ; It's not necessary to zero-extend the arg because it is specified 'zeroext'.
6 define void @bar1(i1 zeroext %v1) nounwind ssp {
9 ; X32-NEXT: movzbl {{[0-9]+}}(%esp), %eax
10 ; X32-NEXT: pushl %eax
11 ; X32-NEXT: calll foo1
12 ; X32-NEXT: addl $4, %esp
17 ; X64-NEXT: xorl %eax, %eax
18 ; X64-NEXT: jmp foo1 # TAILCALL
19 %conv = zext i1 %v1 to i32
20 %call = tail call i32 (...) @foo1(i32 %conv) nounwind
24 ; Check that on x86-64 the arguments are simply forwarded.
25 define void @bar2(i8 zeroext %v1) nounwind ssp {
28 ; X32-NEXT: movzbl {{[0-9]+}}(%esp), %eax
29 ; X32-NEXT: pushl %eax
30 ; X32-NEXT: calll foo1
31 ; X32-NEXT: addl $4, %esp
36 ; X64-NEXT: xorl %eax, %eax
37 ; X64-NEXT: jmp foo1 # TAILCALL
38 %conv = zext i8 %v1 to i32
39 %call = tail call i32 (...) @foo1(i32 %conv) nounwind
43 ; Check that i1 return values are not zero-extended.
44 define zeroext i1 @bar3() nounwind ssp {
47 ; X32-NEXT: calll foo2
52 ; X64-NEXT: pushq %rax
53 ; X64-NEXT: callq foo2
56 %call = call i1 @foo2() nounwind
60 declare i32 @foo1(...)
61 declare zeroext i1 @foo2()