1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s --check-prefix=X86
3; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64
4
5define zeroext i16 @PR49028(i16 zeroext %0, i8* %1) {
6; X86-LABEL: PR49028:
7; X86:       # %bb.0:
8; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
9; X86-NEXT:    movzwl {{[0-9]+}}(%esp), %eax
10; X86-NEXT:    shrl %eax
11; X86-NEXT:    sete (%ecx)
12; X86-NEXT:    # kill: def $ax killed $ax killed $eax
13; X86-NEXT:    retl
14;
15; X64-LABEL: PR49028:
16; X64:       # %bb.0:
17; X64-NEXT:    movl %edi, %eax
18; X64-NEXT:    shrl %eax
19; X64-NEXT:    sete (%rsi)
20; X64-NEXT:    # kill: def $ax killed $ax killed $eax
21; X64-NEXT:    retq
22  %3 = lshr i16 %0, 1
23  %4 = icmp eq i16 %3, 0
24  %5 = zext i1 %4 to i8
25  store i8 %5, i8* %1, align 1
26  ret i16 %3
27}
28