summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/misc-ps-region-store.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-01-09 18:46:17 +0000
committerTed Kremenek <kremenek@apple.com>2013-01-09 18:46:17 +0000
commit2f2edd3fb168a50708e738c810f60a99f998ffe3 (patch)
tree8a5e9329b1efb2d2f74155b5728133e4ef1d7c90 /clang/test/Analysis/misc-ps-region-store.cpp
parent6922e9ca7e2655cc603c2c0655189c72cdfa513f (diff)
downloadbcm5719-llvm-2f2edd3fb168a50708e738c810f60a99f998ffe3.tar.gz
bcm5719-llvm-2f2edd3fb168a50708e738c810f60a99f998ffe3.zip
Do not model loads from complex types, since we don't accurately model the imaginary and real parts yet.
Fixes false positive reported in <rdar://problem/12964481>. llvm-svn: 171987
Diffstat (limited to 'clang/test/Analysis/misc-ps-region-store.cpp')
-rw-r--r--clang/test/Analysis/misc-ps-region-store.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp
index 7b7b8bd3009..de70d3b754d 100644
--- a/clang/test/Analysis/misc-ps-region-store.cpp
+++ b/clang/test/Analysis/misc-ps-region-store.cpp
@@ -705,3 +705,19 @@ void rdar12759044() {
*p = 0xDEADBEEF; // no-warning
}
}
+
+// The analyzer currently does not model complex types. Test that the load
+// from 'x' is not flagged as being uninitialized.
+typedef __complex__ float _ComplexT;
+void rdar12964481(_ComplexT *y) {
+ _ComplexT x;
+ __real__ x = 1.0;
+ __imag__ x = 1.0;
+ *y *= x; // no-warning
+}
+void rdar12964481_b(_ComplexT *y) {
+ _ComplexT x;
+ // Eventually this should be a warning.
+ *y *= x; // no-warning
+}
+
OpenPOWER on IntegriCloud