Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -mtriple=i686-unknown-linux-gnu -o - %s | FileCheck %s
      2 
      3 declare void @f(i16 signext)
      4 declare void @g(i32 signext)
      5 
      6 
      7 define void @flags_match(i16 signext %x) {
      8 entry:
      9   tail call void @f(i16 signext %x)
     10   ret void
     11 
     12 ; The parameter flags match; do the tail call.
     13 ; CHECK-LABEL: flags_match:
     14 ; CHECK: jmp f
     15 }
     16 
     17 define void @flags_mismatch(i16 zeroext %x) {
     18 entry:
     19   tail call void @f(i16 signext %x)
     20   ret void
     21 
     22 ; The parameter flags mismatch. %x has not been sign-extended,
     23 ; so tail call is not possible.
     24 ; CHECK-LABEL: flags_mismatch:
     25 ; CHECK: movswl
     26 ; CHECK: calll f
     27 }
     28 
     29 
     30 define void @mismatch_doesnt_matter(i32 zeroext %x) {
     31 entry:
     32   tail call void @g(i32 signext %x)
     33   ret void
     34 
     35 ; The parameter flags mismatch, but the type is wide enough that
     36 ; no extension takes place in practice, so do the tail call.
     37 
     38 ; CHECK-LABEL: mismatch_doesnt_matter:
     39 ; CHECK: jmp g
     40 }
     41