summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-23 00:26:16 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-23 00:26:16 +0000
commit22cc1a8438664352a54a4e1a1e823ee823ce6e7f (patch)
treec7b6842b0a8634a996acb9799094ab703e9e14ec /clang/test
parent04c5f973ee7bde7a5e4d39a3e443b5b4342a5a0f (diff)
downloadbcm5719-llvm-22cc1a8438664352a54a4e1a1e823ee823ce6e7f.tar.gz
bcm5719-llvm-22cc1a8438664352a54a4e1a1e823ee823ce6e7f.zip
Add basic support for analyzing CastExprs as lvalues.
llvm-svn: 91952
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/misc-ps-region-store.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp
index c3e07b26b00..e1750139c2f 100644
--- a/clang/test/Analysis/misc-ps-region-store.cpp
+++ b/clang/test/Analysis/misc-ps-region-store.cpp
@@ -12,3 +12,14 @@ char test1_as_rvalue() {
return test1_aux();
}
+// Test passing a value as a reference. The 'const' in test2_aux() adds
+// an ImplicitCastExpr, which is evaluated as an lvalue.
+int test2_aux(const int &n);
+int test2(int n) {
+ return test2_aux(n);
+}
+
+int test2_b_aux(const short &n);
+int test2_b(int n) {
+ return test2_b_aux(n);
+}
OpenPOWER on IntegriCloud