1 ; Test that the ToAsciiOptimizer works correctly 2 ; RUN: opt < %s -simplify-libcalls -S | \ 3 ; RUN: not grep {call.*toascii} 4 5 declare i32 @toascii(i32) 6 7 define i32 @main() { 8 %val1 = call i32 @toascii( i32 1 ) ; <i32> [#uses=1] 9 %val2 = call i32 @toascii( i32 0 ) ; <i32> [#uses=1] 10 %val3 = call i32 @toascii( i32 127 ) ; <i32> [#uses=1] 11 %val4 = call i32 @toascii( i32 128 ) ; <i32> [#uses=1] 12 %val5 = call i32 @toascii( i32 255 ) ; <i32> [#uses=1] 13 %val6 = call i32 @toascii( i32 256 ) ; <i32> [#uses=1] 14 %rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1] 15 %rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1] 16 %rslt3 = add i32 %val5, %val6 ; <i32> [#uses=1] 17 %rslt4 = add i32 %rslt1, %rslt2 ; <i32> [#uses=1] 18 %rslt5 = add i32 %rslt4, %rslt3 ; <i32> [#uses=1] 19 ret i32 %rslt5 20 } 21 22