summaryrefslogtreecommitdiff
path: root/test/Analysis/casts.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-09-18 18:58:58 +0000
committerJordan Rose <jordan_rose@apple.com>2013-09-18 18:58:58 +0000
commitd76cec5567cb5b04cb5cc48a477a0c71b910053c (patch)
tree4a92a751a885a5b235b9fc3a8c8c254778eb1bc4 /test/Analysis/casts.cpp
parentf9d38c08bc77da4ebd67fdc7cb4f42da671f7d2b (diff)
downloadclang-d76cec5567cb5b04cb5cc48a477a0c71b910053c.tar.gz
[analyzer] Don't even try to convert floats to booleans for now.
We now have symbols with floating-point type to make sure that (double)x == (double)x comes out true, but we still can't do much with these. For now, don't even bother trying to create a floating-point zero value; just give up on conversion to bool. PR14634, C++ edition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190953 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/casts.cpp')
-rw-r--r--test/Analysis/casts.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/casts.cpp b/test/Analysis/casts.cpp
new file mode 100644
index 0000000000..339539189e
--- /dev/null
+++ b/test/Analysis/casts.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
+// expected-no-diagnostics
+
+bool PR14634(int x) {
+ double y = (double)x;
+ return !y;
+}
+
+bool PR14634_implicit(int x) {
+ double y = (double)x;
+ return y;
+}