xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/fast-isel-ret-ext.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s  -O0 -fast-isel-abort=1 -mtriple i686-apple-darwin10 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s  -O0 -fast-isel-abort=1 -mtriple x86_64-apple-darwin10 | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Workerdefine zeroext i8 @test1(i32 %y) nounwind {
5*9880d681SAndroid Build Coastguard Worker  %conv = trunc i32 %y to i8
6*9880d681SAndroid Build Coastguard Worker  ret i8 %conv
7*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test1:
8*9880d681SAndroid Build Coastguard Worker  ; CHECK: movzbl {{.*}}, %eax
9*9880d681SAndroid Build Coastguard Worker}
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Workerdefine signext i8 @test2(i32 %y) nounwind {
12*9880d681SAndroid Build Coastguard Worker  %conv = trunc i32 %y to i8
13*9880d681SAndroid Build Coastguard Worker  ret i8 %conv
14*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test2:
15*9880d681SAndroid Build Coastguard Worker  ; CHECK: movsbl {{.*}}, %eax
16*9880d681SAndroid Build Coastguard Worker}
17*9880d681SAndroid Build Coastguard Worker
18*9880d681SAndroid Build Coastguard Workerdefine zeroext i16 @test3(i32 %y) nounwind {
19*9880d681SAndroid Build Coastguard Worker  %conv = trunc i32 %y to i16
20*9880d681SAndroid Build Coastguard Worker  ret i16 %conv
21*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test3:
22*9880d681SAndroid Build Coastguard Worker  ; CHECK: movzwl {{.*}}, %eax
23*9880d681SAndroid Build Coastguard Worker}
24*9880d681SAndroid Build Coastguard Worker
25*9880d681SAndroid Build Coastguard Workerdefine signext i16 @test4(i32 %y) nounwind {
26*9880d681SAndroid Build Coastguard Worker  %conv = trunc i32 %y to i16
27*9880d681SAndroid Build Coastguard Worker  ret i16 %conv
28*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test4:
29*9880d681SAndroid Build Coastguard Worker  ; CHECK: {{(movswl.%.x, %eax|cwtl)}}
30*9880d681SAndroid Build Coastguard Worker}
31*9880d681SAndroid Build Coastguard Worker
32*9880d681SAndroid Build Coastguard Workerdefine zeroext i1 @test5(i32 %y) nounwind {
33*9880d681SAndroid Build Coastguard Worker  %conv = trunc i32 %y to i1
34*9880d681SAndroid Build Coastguard Worker  ret i1 %conv
35*9880d681SAndroid Build Coastguard Worker  ; CHECK-LABEL: test5:
36*9880d681SAndroid Build Coastguard Worker  ; CHECK: andb $1
37*9880d681SAndroid Build Coastguard Worker  ; CHECK: movzbl {{.*}}, %eax
38*9880d681SAndroid Build Coastguard Worker}
39