2005-05-14 16:44:43 +00:00
|
|
|
; Test that the ToAsciiOptimizer works correctly
|
2007-04-16 15:31:49 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -simplify-libcalls | llvm-dis | \
|
|
|
|
; RUN: not grep {call.*%ffs}
|
2005-05-14 16:44:43 +00:00
|
|
|
|
|
|
|
declare int %ffs(int)
|
|
|
|
declare int %ffsl(int)
|
|
|
|
declare int %ffsll(long)
|
2005-05-15 21:26:59 +00:00
|
|
|
|
|
|
|
%non_const = external global int
|
2005-05-14 16:44:43 +00:00
|
|
|
|
|
|
|
implementation ; Functions:
|
|
|
|
|
|
|
|
int %main () {
|
2005-05-15 21:26:59 +00:00
|
|
|
%arg = load int* %non_const
|
|
|
|
%val0 = call int %ffs(int %arg)
|
2005-05-14 16:44:43 +00:00
|
|
|
%val1 = call int %ffs(int 1)
|
2005-05-15 21:35:26 +00:00
|
|
|
%val2 = call int %ffs(int 2048)
|
2005-05-14 16:44:43 +00:00
|
|
|
%val3 = call int %ffsl(int 65536)
|
|
|
|
%val4 = call int %ffsll(long 1024)
|
|
|
|
%val5 = call int %ffsll(long 17179869184)
|
|
|
|
%val6 = call int %ffsll(long 1152921504606846976)
|
2005-05-15 21:35:26 +00:00
|
|
|
%rslt1 = add int %val1, %val2
|
2005-05-14 16:44:43 +00:00
|
|
|
%rslt2 = add int %val3, %val4
|
|
|
|
%rslt3 = add int %val5, %val6
|
|
|
|
%rslt4 = add int %rslt1, %rslt2
|
|
|
|
%rslt5 = add int %rslt4, %rslt3
|
2005-05-15 21:26:59 +00:00
|
|
|
%rslt6 = add int %rslt5, %val0
|
2005-05-14 16:44:43 +00:00
|
|
|
ret int %rslt5
|
|
|
|
}
|