blob: 166185a545d153cb8c970d00f5ee7d69e85f4447 [file] [log] [blame]
Dan Gohman3c7d3082009-09-11 18:01:28 +00001; RUN: opt < %s -inline -S | grep {ret i32 1}
Dan Gohmanf17a25c2007-07-18 16:29:46 +00002; ModuleID = 'short.opt.bc'
3
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00004define i32 @testBool(i1 %X) {
5 %tmp = zext i1 %X to i32 ; <i32> [#uses=1]
6 ret i32 %tmp
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007}
8
Tanya Lattner4c4d0b82008-03-01 09:15:35 +00009define i32 @testByte(i8 %X) {
10 %tmp = icmp ne i8 %X, 0 ; <i1> [#uses=1]
11 %tmp.i = zext i1 %tmp to i32 ; <i32> [#uses=1]
12 ret i32 %tmp.i
Dan Gohmanf17a25c2007-07-18 16:29:46 +000013}
14
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000015define i32 @main() {
16 %rslt = call i32 @testByte( i8 123 ) ; <i32> [#uses=1]
17 ret i32 %rslt
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018}
Tanya Lattner4c4d0b82008-03-01 09:15:35 +000019