diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-07-17 00:40:32 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-07-17 00:40:32 +0000 |
commit | 8b9fd890e316f804e093ec1003d7fa4a7d2ec85c (patch) | |
tree | f5821366ba1794288198a495eee6e432ff196f73 /clang/test/Analysis/idempotent-operations.c | |
parent | 83f250f005d4bfbe5c85c0d998adc55ec16e054a (diff) | |
download | bcm5719-llvm-8b9fd890e316f804e093ec1003d7fa4a7d2ec85c.tar.gz bcm5719-llvm-8b9fd890e316f804e093ec1003d7fa4a7d2ec85c.zip |
Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
an APFloat with different "float semantics" than the compared float literal.
llvm-svn: 108590
Diffstat (limited to 'clang/test/Analysis/idempotent-operations.c')
-rw-r--r-- | clang/test/Analysis/idempotent-operations.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/idempotent-operations.c b/clang/test/Analysis/idempotent-operations.c index 72adb8ef25c..94e972c5519 100644 --- a/clang/test/Analysis/idempotent-operations.c +++ b/clang/test/Analysis/idempotent-operations.c @@ -3,6 +3,7 @@ // Basic tests extern void test(int i); +extern void test_f(float f); void basic() { int x = 10, zero = 0, one = 1; @@ -50,3 +51,8 @@ void basic() { test(zero << x); // expected-warning {{idempotent operation; the left operand is always 0}} test(zero >> x); // expected-warning {{idempotent operation; the left operand is always 0}} } + +void floats(float x) { + test_f(x * 1.0); // no-warning + test_f(x * 1.0F); // no-warning +} |