summaryrefslogtreecommitdiffstats
path: root/clang/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
commit36bc6b45590158fae555169677bc0b8d2103c588 (patch)
tree04b4829ec17ff7f877952cdf04b303bc64597a66 /clang/test/Analysis/casts.cpp
parent5eef1ca1921918ac9940525063eeef3bd888b3a7 (diff)
downloadbcm5719-llvm-36bc6b45590158fae555169677bc0b8d2103c588.tar.gz
bcm5719-llvm-36bc6b45590158fae555169677bc0b8d2103c588.zip
[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. llvm-svn: 190953
Diffstat (limited to 'clang/test/Analysis/casts.cpp')
-rw-r--r--clang/test/Analysis/casts.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Analysis/casts.cpp b/clang/test/Analysis/casts.cpp
new file mode 100644
index 00000000000..339539189ed
--- /dev/null
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud