llvm-6502/test/Transforms/SimplifyLibCalls/FFS.ll
Chandler Carruth 1de43ede89 Fix the remaining TCL-style quotes found in the testsuite. This is
another mechanical change accomplished though the power of terrible Perl
scripts.

I have manually switched some "s to 's to make escaping simpler.

While I started this to fix tests that aren't run in all configurations,
the massive number of tests is due to a really frustrating fragility of
our testing infrastructure: things like 'grep -v', 'not grep', and
'expected failures' can mask broken tests all too easily.

Essentially, I'm deeply disturbed that I can change the testsuite so
radically without causing any change in results for most platforms. =/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:09:46 +00:00

37 lines
1.1 KiB
LLVM

; Test that the ToAsciiOptimizer works correctly
; RUN: opt < %s -simplify-libcalls -S | \
; RUN: not grep "call.*@ffs"
@non_const = external global i32 ; <i32*> [#uses=1]
declare i32 @ffs(i32)
declare i32 @ffsl(i32)
declare i32 @ffsll(i64)
define i32 @main() {
%arg = load i32* @non_const ; <i32> [#uses=1]
%val0 = call i32 @ffs( i32 %arg ) ; <i32> [#uses=1]
%val1 = call i32 @ffs( i32 1 ) ; <i32> [#uses=1]
%val2 = call i32 @ffs( i32 2048 ) ; <i32> [#uses=1]
%val3 = call i32 @ffsl( i32 65536 ) ; <i32> [#uses=1]
%val4 = call i32 @ffsll( i64 1024 ) ; <i32> [#uses=1]
%val5 = call i32 @ffsll( i64 17179869184 ) ; <i32> [#uses=1]
%val6 = call i32 @ffsll( i64 1152921504606846976 ) ; <i32> [#uses=1]
%rslt1 = add i32 %val1, %val2 ; <i32> [#uses=1]
%rslt2 = add i32 %val3, %val4 ; <i32> [#uses=1]
%rslt3 = add i32 %val5, %val6 ; <i32> [#uses=1]
%rslt4 = add i32 %rslt1, %rslt2 ; <i32> [#uses=1]
%rslt5 = add i32 %rslt4, %rslt3 ; <i32> [#uses=2]
%rslt6 = add i32 %rslt5, %val0 ; <i32> [#uses=0]
ret i32 %rslt5
}
; PR4206
define i32 @a(i64) nounwind {
%2 = call i32 @ffsll(i64 %0) ; <i32> [#uses=1]
ret i32 %2
}