aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/reference.cpp')
-rw-r--r--test/Analysis/reference.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/Analysis/reference.cpp b/test/Analysis/reference.cpp
index 54d7cf57e0..6b962157da 100644
--- a/test/Analysis/reference.cpp
+++ b/test/Analysis/reference.cpp
@@ -9,3 +9,18 @@ void f1() {
if (b != 3)
*p = 1; // no-warning
}
+
+char* ptr();
+char& ref();
+
+// These next two tests just shouldn't crash.
+char t1 () {
+ ref() = 'c';
+ return '0';
+}
+
+// just a sanity test, the same behavior as t1()
+char t2 () {
+ *ptr() = 'c';
+ return '0';
+}