xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/h-registers-3.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1; RUN: llc < %s -mtriple=i686-unknown-linux-gnu   | FileCheck %s -check-prefix=X86
2; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s -check-prefix=X64
3; RUN: llc < %s -mtriple=x86_64-linux-gnux32      | FileCheck %s -check-prefix=X32
4
5define zeroext i8 @foo() nounwind ssp {
6entry:
7  %0 = tail call zeroext i16 (...) @bar() nounwind
8  %1 = lshr i16 %0, 8
9  %2 = trunc i16 %1 to i8
10  ret i8 %2
11
12; X86-LABEL: foo
13; X86: calll
14; X86-NEXT: movb %ah, %al
15; X86-NEXT: addl $12, %esp
16; X86-NEXT: retl
17
18; X64-LABEL: foo
19; X64: callq
20; X64-NEXT: # kill
21; X64-NEXT: shrl $8, %eax
22; X64-NEXT: # kill
23; X64-NEXT: popq
24; X64-NEXT: retq
25
26; X32-LABEL: foo
27; X32: callq
28; X32-NEXT: # kill
29; X32-NEXT: shrl $8, %eax
30; X32-NEXT: # kill
31; X32-NEXT: popq
32; X32-NEXT: retq
33}
34
35declare zeroext i16 @bar(...)
36