summaryrefslogtreecommitdiffstats
path: root/test/Analysis/misc-ps-region-store.mm
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-22 22:13:46 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-22 22:13:46 +0000
commit38ac4f504bf8ed514520b5a82be538bdb0860687 (patch)
tree92e1ffc92049a2b0a4339c0bbe1f19a8c49b88da /test/Analysis/misc-ps-region-store.mm
parent5affb539acc91ecb47216ae817d17accbd80d6a2 (diff)
Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/misc-ps-region-store.mm')
-rw-r--r--test/Analysis/misc-ps-region-store.mm31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Analysis/misc-ps-region-store.mm b/test/Analysis/misc-ps-region-store.mm
new file mode 100644
index 0000000000..fd92759012
--- /dev/null
+++ b/test/Analysis/misc-ps-region-store.mm
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify -fblocks -analyzer-opt-analyze-nested-blocks %s
+
+//===------------------------------------------------------------------------------------------===//
+// This files tests our path-sensitive handling of Objective-c++ files.
+//===------------------------------------------------------------------------------------------===//
+
+// Test basic handling of references.
+char &test1_aux();
+char *test1() {
+ return &test1_aux();
+}
+
+// Test test1_aux() evaluates to char &.
+char test1_as_rvalue() {
+ return test1_aux();
+}
+
+// Test basic handling of references with Objective-C classes.
+@interface Test1
+- (char&) foo;
+@end
+
+char* Test1_harness(Test1 *p) {
+ return &[p foo];
+}
+
+char Test1_harness_b(Test1 *p) {
+ return [p foo];
+}
+