2005-05-04 17:34:55 +00:00
|
|
|
; Test that the IsDigitOptimizer works correctly
|
2007-04-15 05:16:38 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
|
|
|
|
; RUN: not grep call
|
2005-05-04 17:34:55 +00:00
|
|
|
|
|
|
|
declare int %isdigit(int)
|
2005-09-29 06:16:37 +00:00
|
|
|
declare int %isascii(int)
|
2005-05-04 17:34:55 +00:00
|
|
|
|
|
|
|
implementation ; Functions:
|
|
|
|
|
|
|
|
int %main () {
|
|
|
|
%val1 = call int %isdigit(int 47)
|
|
|
|
%val2 = call int %isdigit(int 48)
|
|
|
|
%val3 = call int %isdigit(int 57)
|
|
|
|
%val4 = call int %isdigit(int 58)
|
|
|
|
%rslt1 = add int %val1, %val2
|
|
|
|
%rslt2 = add int %val3, %val4
|
2005-05-04 17:45:10 +00:00
|
|
|
%sum = add int %rslt1, %rslt2
|
|
|
|
%rslt = call int %isdigit(int %sum)
|
2005-09-29 06:16:37 +00:00
|
|
|
%tmp = call int %isascii(int %rslt)
|
|
|
|
ret int %tmp
|
2005-05-04 17:34:55 +00:00
|
|
|
}
|