blob: a7b051b067ca73057c6953084aef5601f5ce8bd5 [file] [log] [blame]
Chandler Carrutha5a29f92012-07-02 12:47:22 +00001; RUN: opt < %s -inline -S | grep "ret i32 1"
Reid Spencer6c38f0b2006-11-27 01:05:10 +00002; ModuleID = 'short.opt.bc'
3
Tanya Lattner5640bd12008-03-01 09:15:35 +00004define i32 @testBool(i1 %X) {
5 %tmp = zext i1 %X to i32 ; <i32> [#uses=1]
6 ret i32 %tmp
Reid Spencer6c38f0b2006-11-27 01:05:10 +00007}
8
Tanya Lattner5640bd12008-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
Reid Spencer6c38f0b2006-11-27 01:05:10 +000013}
14
Tanya Lattner5640bd12008-03-01 09:15:35 +000015define i32 @main() {
16 %rslt = call i32 @testByte( i8 123 ) ; <i32> [#uses=1]
17 ret i32 %rslt
Reid Spencer6c38f0b2006-11-27 01:05:10 +000018}
Tanya Lattner5640bd12008-03-01 09:15:35 +000019