blob: 9553b1b578b15d509749d2127ed8249c5c6769aa [file] [log] [blame]
Dan Gohman36a09472009-09-08 23:54:48 +00001; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | grep movzx | count 1
2; RUN: llc < %s -march=x86 -x86-asm-syntax=intel | grep movsx | count 1
Chris Lattnere4e49132005-12-14 19:24:08 +00003
Tanya Lattner33eefff2008-02-21 07:42:26 +00004@G1 = internal global i8 0 ; <i8*> [#uses=1]
5@G2 = internal global i8 0 ; <i8*> [#uses=1]
Chris Lattnere4e49132005-12-14 19:24:08 +00006
Tanya Lattner33eefff2008-02-21 07:42:26 +00007define i16 @test1() {
8 %tmp.0 = load i8* @G1 ; <i8> [#uses=1]
9 %tmp.3 = zext i8 %tmp.0 to i16 ; <i16> [#uses=1]
10 ret i16 %tmp.3
Chris Lattnere4e49132005-12-14 19:24:08 +000011}
12
Tanya Lattner33eefff2008-02-21 07:42:26 +000013define i16 @test2() {
14 %tmp.0 = load i8* @G2 ; <i8> [#uses=1]
15 %tmp.3 = sext i8 %tmp.0 to i16 ; <i16> [#uses=1]
16 ret i16 %tmp.3
Chris Lattnere4e49132005-12-14 19:24:08 +000017}
Tanya Lattner33eefff2008-02-21 07:42:26 +000018