xref: /llvm-project/llvm/test/CodeGen/X86/extend.ll (revision 2f448bf509432c1a19ec46ab8cbc7353c03c6280)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=i686-- -x86-asm-syntax=intel | FileCheck %s
3
4@G1 = internal global i8 0              ; <ptr> [#uses=1]
5@G2 = internal global i8 0              ; <ptr> [#uses=1]
6
7define i16 @test1() {
8; CHECK-LABEL: test1:
9; CHECK:       # %bb.0:
10; CHECK-NEXT:    movzx eax, byte ptr [G1]
11; CHECK-NEXT:    # kill: def $ax killed $ax killed $eax
12; CHECK-NEXT:    ret
13        %tmp.0 = load i8, ptr @G1           ; <i8> [#uses=1]
14        %tmp.3 = zext i8 %tmp.0 to i16          ; <i16> [#uses=1]
15        ret i16 %tmp.3
16}
17
18define i16 @test2() {
19; CHECK-LABEL: test2:
20; CHECK:       # %bb.0:
21; CHECK-NEXT:    movsx eax, byte ptr [G2]
22; CHECK-NEXT:    # kill: def $ax killed $ax killed $eax
23; CHECK-NEXT:    ret
24        %tmp.0 = load i8, ptr @G2           ; <i8> [#uses=1]
25        %tmp.3 = sext i8 %tmp.0 to i16          ; <i16> [#uses=1]
26        ret i16 %tmp.3
27}
28
29