summaryrefslogtreecommitdiffstats
path: root/test/Analysis/misc-ps-region-store.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/misc-ps-region-store.cpp')
-rw-r--r--test/Analysis/misc-ps-region-store.cpp81
1 files changed, 81 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp
index bfa5e5c..1dba09d 100644
--- a/test/Analysis/misc-ps-region-store.cpp
+++ b/test/Analysis/misc-ps-region-store.cpp
@@ -159,3 +159,84 @@ int r8375510(R8375510 x, R8375510 y) {
for (; ; x++) { }
}
+// PR8419 -- this used to crash.
+
+class String8419 {
+ public:
+ char& get(int n);
+ char& operator[](int n);
+};
+
+char& get8419();
+
+void Test8419() {
+ String8419 s;
+ ++(s.get(0));
+ get8419()--; // used to crash
+ --s[0]; // used to crash
+ s[0] &= 1; // used to crash
+ s[0]++; // used to crash
+}
+
+// PR8426 -- this used to crash.
+
+void Use(void* to);
+
+template <class T> class Foo {
+ ~Foo();
+ struct Bar;
+ Bar* bar_;
+};
+
+template <class T> Foo<T>::~Foo() {
+ Use(bar_);
+ T::DoSomething();
+ bar_->Work();
+}
+
+// PR8427 -- this used to crash.
+
+class Dummy {};
+
+bool operator==(Dummy, int);
+
+template <typename T>
+class Foo2 {
+ bool Bar();
+};
+
+template <typename T>
+bool Foo2<T>::Bar() {
+ return 0 == T();
+}
+
+// PR8433 -- this used to crash.
+
+template <typename T>
+class Foo3 {
+ public:
+ void Bar();
+ void Baz();
+ T value_;
+};
+
+template <typename T>
+void Foo3<T>::Bar() {
+ Baz();
+ value_();
+}
+
+//===---------------------------------------------------------------------===//
+// Handle misc. C++ constructs.
+//===---------------------------------------------------------------------===//
+
+namespace fum {
+ int i = 3;
+};
+
+void test_namespace() {
+ // Previously triggered a crash.
+ using namespace fum;
+ int x = i;
+}
+
OpenPOWER on IntegriCloud