aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/ctor-inlining.mm
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-01-31 18:04:03 +0000
committerJordan Rose <jordan_rose@apple.com>2013-01-31 18:04:03 +0000
commit33e83b6cf776875be5716d214710717a898325c0 (patch)
tree06bd8d5a649c23e2739fe4d9ffcd8a76bbaf12ad /test/Analysis/ctor-inlining.mm
parentce76d655d7c99f515bea37611395423026e0e513 (diff)
Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
It's causing hangs on our internal analyzer buildbot. Will restore after investigating. This reverts r173951 / baa7ca1142990e1ad6d4e9d2c73adb749ff50789. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/ctor-inlining.mm')
-rw-r--r--test/Analysis/ctor-inlining.mm102
1 files changed, 1 insertions, 101 deletions
diff --git a/test/Analysis/ctor-inlining.mm b/test/Analysis/ctor-inlining.mm
index 1603ff3893..be5d81a58e 100644
--- a/test/Analysis/ctor-inlining.mm
+++ b/test/Analysis/ctor-inlining.mm
@@ -1,15 +1,8 @@
-// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fobjc-arc -analyzer-config c++-inlining=constructors -Wno-null-dereference -std=c++11 -verify %s
+// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -fobjc-arc -analyzer-config c++-inlining=constructors -Wno-null-dereference -verify %s
void clang_analyzer_eval(bool);
void clang_analyzer_checkInlined(bool);
-// A simplified version of std::move.
-template <typename T>
-T &&move(T &obj) {
- return static_cast<T &&>(obj);
-}
-
-
struct Wrapper {
__strong id obj;
};
@@ -124,96 +117,3 @@ namespace ConstructorUsedAsRValue {
clang_analyzer_eval(result); // expected-warning{{TRUE}}
}
}
-
-namespace PODUninitialized {
- class POD {
- public:
- int x, y;
- };
-
- class PODWrapper {
- public:
- POD p;
- };
-
- class NonPOD {
- public:
- int x, y;
-
- NonPOD() {}
- NonPOD(const NonPOD &Other)
- : x(Other.x), y(Other.y) // expected-warning {{undefined}}
- {
- }
- NonPOD(NonPOD &&Other)
- : x(Other.x), y(Other.y) // expected-warning {{undefined}}
- {
- }
- };
-
- class NonPODWrapper {
- public:
- class Inner {
- public:
- int x, y;
-
- Inner() {}
- Inner(const Inner &Other)
- : x(Other.x), y(Other.y) // expected-warning {{undefined}}
- {
- }
- Inner(Inner &&Other)
- : x(Other.x), y(Other.y) // expected-warning {{undefined}}
- {
- }
- };
-
- Inner p;
- };
-
- void testPOD() {
- POD p;
- p.x = 1;
- POD p2 = p; // no-warning
- clang_analyzer_eval(p2.x == 1); // expected-warning{{TRUE}}
- POD p3 = move(p); // no-warning
- clang_analyzer_eval(p3.x == 1); // expected-warning{{TRUE}}
-
- // Use rvalues as well.
- clang_analyzer_eval(POD(p3).x == 1); // expected-warning{{TRUE}}
-
- PODWrapper w;
- w.p.y = 1;
- PODWrapper w2 = w; // no-warning
- clang_analyzer_eval(w2.p.y == 1); // expected-warning{{TRUE}}
- PODWrapper w3 = move(w); // no-warning
- clang_analyzer_eval(w3.p.y == 1); // expected-warning{{TRUE}}
-
- // Use rvalues as well.
- clang_analyzer_eval(PODWrapper(w3).p.y == 1); // expected-warning{{TRUE}}
- }
-
- void testNonPOD() {
- NonPOD p;
- p.x = 1;
- NonPOD p2 = p;
- }
-
- void testNonPODMove() {
- NonPOD p;
- p.x = 1;
- NonPOD p2 = move(p);
- }
-
- void testNonPODWrapper() {
- NonPODWrapper w;
- w.p.y = 1;
- NonPODWrapper w2 = w;
- }
-
- void testNonPODWrapperMove() {
- NonPODWrapper w;
- w.p.y = 1;
- NonPODWrapper w2 = move(w);
- }
-}