summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/h-registers-3.ll
blob: 564b1e8e15b23f11b9503194daaf8a0e91174bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple=i686-unknown-linux-gnu   | FileCheck %s -check-prefix=X86
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s -check-prefix=X64
; RUN: llc < %s -mtriple=x86_64-linux-gnux32      | FileCheck %s -check-prefix=X32

define zeroext i8 @foo() nounwind ssp {
; X86-LABEL: foo:
; X86:       # %bb.0: # %entry
; X86-NEXT:    subl $12, %esp
; X86-NEXT:    calll bar
; X86-NEXT:    movb %ah, %al
; X86-NEXT:    addl $12, %esp
; X86-NEXT:    retl
;
; X64-LABEL: foo:
; X64:       # %bb.0: # %entry
; X64-NEXT:    pushq %rax
; X64-NEXT:    xorl %eax, %eax
; X64-NEXT:    callq bar
; X64-NEXT:    # kill: def $ax killed $ax def $eax
; X64-NEXT:    shrl $8, %eax
; X64-NEXT:    # kill: def $al killed $al killed $eax
; X64-NEXT:    popq %rcx
; X64-NEXT:    retq
;
; X32-LABEL: foo:
; X32:       # %bb.0: # %entry
; X32-NEXT:    pushq %rax
; X32-NEXT:    xorl %eax, %eax
; X32-NEXT:    callq bar
; X32-NEXT:    # kill: def $ax killed $ax def $eax
; X32-NEXT:    shrl $8, %eax
; X32-NEXT:    # kill: def $al killed $al killed $eax
; X32-NEXT:    popq %rcx
; X32-NEXT:    retq
entry:
  %0 = tail call zeroext i16 (...) @bar() nounwind
  %1 = lshr i16 %0, 8
  %2 = trunc i16 %1 to i8
  ret i8 %2



}

declare zeroext i16 @bar(...)
OpenPOWER on IntegriCloud