llvm/llvm/test/CodeGen/X86/GlobalISel/legalize-sext.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
# RUN: llc -mtriple=i386-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=X86-32
# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=X86-64

# test exts

...
---
name:            test_sext16
body:             |
  bb.1:
    ; X86-32-LABEL: name: test_sext16
    ; X86-32: [[DEF:%[0-9]+]]:_(s8) = IMPLICIT_DEF
    ; X86-32-NEXT: [[SEXT:%[0-9]+]]:_(s16) = G_SEXT [[DEF]](s8)
    ; X86-32-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY [[SEXT]](s16)
    ; X86-32-NEXT: RET 0, implicit [[COPY]](s16)
    ; X86-64-LABEL: name: test_sext16
    ; X86-64: [[DEF:%[0-9]+]]:_(s8) = IMPLICIT_DEF
    ; X86-64-NEXT: [[SEXT:%[0-9]+]]:_(s16) = G_SEXT [[DEF]](s8)
    ; X86-64-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY [[SEXT]](s16)
    ; X86-64-NEXT: RET 0, implicit [[COPY]](s16)
    %0:_(s8) = IMPLICIT_DEF
    %1:_(s16) = G_SEXT %0
    %2:_(s16) = COPY %1(s16)
    RET 0, implicit %2

...