blob: fd768cb9b336826b18833e75655d1e3d0283912b [file] [log] [blame]
Eli Friedmandc515752011-05-19 22:16:13 +00001; 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
4define 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
11define 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
18define 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
25define 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
32define 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}