Fix a bunch of issues found in a testcase from 400.perlbench.
[oota-llvm.git] / test / Transforms / SimplifyLibCalls / ToAscii.ll
1 ; Test that the ToAsciiOptimizer works correctly
2 ; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
3 ; RUN:   not grep {call.*toascii}
4
5 declare int %toascii(int)
6
7 implementation   ; Functions:
8
9 int %main () {
10   %val1 = call int %toascii(int 1)
11   %val2 = call int %toascii(int 0)
12   %val3 = call int %toascii(int 127)
13   %val4 = call int %toascii(int 128)
14   %val5 = call int %toascii(int 255)
15   %val6 = call int %toascii(int 256)
16   %rslt1 = add int %val1, %val2
17   %rslt2 = add int %val3, %val4
18   %rslt3 = add int %val5, %val6
19   %rslt4 = add int %rslt1, %rslt2
20   %rslt5 = add int %rslt4, %rslt3
21   ret int %rslt5
22 }