brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · 539be24 Raw
63 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-unknown-unknown | FileCheck %s -check-prefix=X323; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s -check-prefix=X644 5; It's not necessary to zero-extend the arg because it is specified 'zeroext'.6define void @bar1(i1 zeroext %v1) nounwind ssp {7; X32-LABEL: bar1:8; X32:       # %bb.0:9; X32-NEXT:    movzbl {{[0-9]+}}(%esp), %eax10; X32-NEXT:    pushl %eax11; X32-NEXT:    calll foo112; X32-NEXT:    addl $4, %esp13; X32-NEXT:    retl14;15; X64-LABEL: bar1:16; X64:       # %bb.0:17; X64-NEXT:    xorl %eax, %eax18; X64-NEXT:    jmp foo1 # TAILCALL19  %conv = zext i1 %v1 to i3220  %call = tail call i32 (...) @foo1(i32 %conv) nounwind21  ret void22}23 24; Check that on x86-64 the arguments are simply forwarded.25define void @bar2(i8 zeroext %v1) nounwind ssp {26; X32-LABEL: bar2:27; X32:       # %bb.0:28; X32-NEXT:    movzbl {{[0-9]+}}(%esp), %eax29; X32-NEXT:    pushl %eax30; X32-NEXT:    calll foo131; X32-NEXT:    addl $4, %esp32; X32-NEXT:    retl33;34; X64-LABEL: bar2:35; X64:       # %bb.0:36; X64-NEXT:    xorl %eax, %eax37; X64-NEXT:    jmp foo1 # TAILCALL38  %conv = zext i8 %v1 to i3239  %call = tail call i32 (...) @foo1(i32 %conv) nounwind40  ret void41}42 43; Check that i1 return values are not zero-extended.44define zeroext i1 @bar3() nounwind ssp {45; X32-LABEL: bar3:46; X32:       # %bb.0:47; X32-NEXT:    calll foo2@PLT48; X32-NEXT:    retl49;50; X64-LABEL: bar3:51; X64:       # %bb.0:52; X64-NEXT:    pushq %rax53; X64-NEXT:    callq foo2@PLT54; X64-NEXT:    popq %rcx55; X64-NEXT:    retq56  %call = call i1 @foo2() nounwind57  ret i1 %call58}59 60declare dso_local i32 @foo1(...)61declare zeroext i1 @foo2()62 63