; Test that the IsDigitOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*isdigit' 

declare int %isdigit(int)

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
  %rslt = add int %rslt1, %rslt2
  ret int %rslt
}

; Test that the IsDigitOptimizer works correctly
; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*isdigit' 

declare int %isdigit(int)

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
  %sum = add int %rslt1, %rslt2
  %rslt = call int %isdigit(int %sum)
  ret int %rslt
}

Make sure both optimization cases get tested.
Make sure both optimization cases get tested.


git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@21687 91177308-0d34-0410-b5e6-96231b3b80d8
