Home | History | Annotate | Download | only in X86
      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
      4 
      5 ; It's not necessary to zero-extend the arg because it is specified 'zeroext'. 
      6 define void @bar1(i1 zeroext %v1) nounwind ssp {
      7 ; X32-LABEL: bar1:
      8 ; X32:       # %bb.0:
      9 ; X32-NEXT:    movzbl {{[0-9]+}}(%esp), %eax
     10 ; X32-NEXT:    pushl %eax
     11 ; X32-NEXT:    calll foo1
     12 ; X32-NEXT:    addl $4, %esp
     13 ; X32-NEXT:    retl
     14 ;
     15 ; X64-LABEL: bar1:
     16 ; X64:       # %bb.0:
     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
     21   ret void
     22 }
     23 
     24 ; Check that on x86-64 the arguments are simply forwarded.
     25 define void @bar2(i8 zeroext %v1) nounwind ssp {
     26 ; X32-LABEL: bar2:
     27 ; X32:       # %bb.0:
     28 ; X32-NEXT:    movzbl {{[0-9]+}}(%esp), %eax
     29 ; X32-NEXT:    pushl %eax
     30 ; X32-NEXT:    calll foo1
     31 ; X32-NEXT:    addl $4, %esp
     32 ; X32-NEXT:    retl
     33 ;
     34 ; X64-LABEL: bar2:
     35 ; X64:       # %bb.0:
     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
     40   ret void
     41 }
     42 
     43 ; Check that i1 return values are not zero-extended.
     44 define zeroext i1 @bar3() nounwind ssp {
     45 ; X32-LABEL: bar3:
     46 ; X32:       # %bb.0:
     47 ; X32-NEXT:    calll foo2
     48 ; X32-NEXT:    retl
     49 ;
     50 ; X64-LABEL: bar3:
     51 ; X64:       # %bb.0:
     52 ; X64-NEXT:    pushq %rax
     53 ; X64-NEXT:    callq foo2
     54 ; X64-NEXT:    popq %rcx
     55 ; X64-NEXT:    retq
     56   %call = call i1 @foo2() nounwind
     57   ret i1 %call
     58 }
     59 
     60 declare i32 @foo1(...)
     61 declare zeroext i1 @foo2()
     62 
     63