Add fast-isel support for zeroext and signext ret instructions on x86.
[oota-llvm.git] / test / CodeGen / X86 / fast-isel-ret-ext.ll
1 ; RUN: llc < %s  -O0 -fast-isel-abort -mtriple i686-apple-darwin10 | FileCheck %s
2 ; RUN: llc < %s  -O0 -fast-isel-abort -mtriple x86_64-apple-darwin10 | FileCheck %s
3
4 define zeroext i8 @test1(i32 %y) nounwind {
5   %conv = trunc i32 %y to i8
6   ret i8 %conv
7   ; CHECK: test1:
8   ; CHECK: movzbl {{.*}}, %eax
9 }
10
11 define signext i8 @test2(i32 %y) nounwind {
12   %conv = trunc i32 %y to i8
13   ret i8 %conv
14   ; CHECK: test2:
15   ; CHECK: movsbl {{.*}}, %eax
16 }
17
18 define zeroext i16 @test3(i32 %y) nounwind {
19   %conv = trunc i32 %y to i16
20   ret i16 %conv
21   ; CHECK: test3:
22   ; CHECK: movzwl {{.*}}, %eax
23 }
24
25 define signext i16 @test4(i32 %y) nounwind {
26   %conv = trunc i32 %y to i16
27   ret i16 %conv
28   ; CHECK: test4:
29   ; CHECK: movswl {{.*}}, %eax
30 }
31
32 define zeroext i1 @test5(i32 %y) nounwind {
33   %conv = trunc i32 %y to i1
34   ret i1 %conv
35   ; CHECK: test5:
36   ; CHECK: andb $1
37   ; CHECK: movzbl {{.*}}, %eax
38 }