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 | 453293109e670824d84e94c0c2891737e3261f1f (patch) | |
tree | 7803d4cf66a1ed553c26a4fadca864202f045819 /test/Analysis/idempotent-operations.c | |
parent | fbd4bf16341c1b23181c829ef2630d9a643e793c (diff) |
Fix APFloat assertion failure in IdempotentOperationChecker resulting in having
an APFloat with different "float semantics" than the compared float literal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108590 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/idempotent-operations.c')
-rw-r--r-- | test/Analysis/idempotent-operations.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Analysis/idempotent-operations.c b/test/Analysis/idempotent-operations.c index 72adb8ef25..94e972c551 100644 --- a/test/Analysis/idempotent-operations.c +++ b/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 +} |