summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorKristof Umann <dkszelethus@gmail.com>2018-08-21 10:45:21 +0000
committerKristof Umann <dkszelethus@gmail.com>2018-08-21 10:45:21 +0000
commit646019655c2e152ab0655033a33bc39b4fac6bc5 (patch)
treee66ffd99ca36878a20ef9855d831220d50760fdb /clang/test
parent8e15b430929c775de731e8218dfb26761042419b (diff)
downloadbcm5719-llvm-646019655c2e152ab0655033a33bc39b4fac6bc5.tar.gz
bcm5719-llvm-646019655c2e152ab0655033a33bc39b4fac6bc5.zip
[analyzer][UninitializedObjectChecker] Refactoring p6.: Move dereferencing to a function
Now that it has it's own file, it makes little sense for isPointerOrReferenceUninit to be this large, so I moved dereferencing to a separate function. Differential Revision: https://reviews.llvm.org/D50509 llvm-svn: 340265
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
index eb7ac2590d0..f214a86adfc 100644
--- a/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
+++ b/clang/test/Analysis/cxx-uninitialized-object-ptr-ref.cpp
@@ -194,15 +194,28 @@ void fCharPointerTest() {
CharPointerTest();
}
-struct CyclicPointerTest {
+struct CyclicPointerTest1 {
int *ptr;
- CyclicPointerTest() : ptr(reinterpret_cast<int *>(&ptr)) {}
+ CyclicPointerTest1() : ptr(reinterpret_cast<int *>(&ptr)) {}
};
-void fCyclicPointerTest() {
- CyclicPointerTest();
+void fCyclicPointerTest1() {
+ CyclicPointerTest1();
}
+// TODO: Currently, the checker ends up in an infinite loop for the following
+// test case.
+/*
+struct CyclicPointerTest2 {
+ int **pptr;
+ CyclicPointerTest2() : pptr(reinterpret_cast<int **>(&pptr)) {}
+};
+
+void fCyclicPointerTest2() {
+ CyclicPointerTest2();
+}
+*/
+
//===----------------------------------------------------------------------===//
// Void pointer tests.
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud