summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-07-29 01:31:59 +0000
committerTed Kremenek <kremenek@apple.com>2010-07-29 01:31:59 +0000
commit8bedb7dd3fcb868ad80c54e94e6fe6e2b04604ae (patch)
tree896b72afb483af4a4c1250af77fd582b0d3848a6 /clang/test
parentef6d5933a66321865ca82a65a04490b84e260dbb (diff)
downloadbcm5719-llvm-8bedb7dd3fcb868ad80c54e94e6fe6e2b04604ae.tar.gz
bcm5719-llvm-8bedb7dd3fcb868ad80c54e94e6fe6e2b04604ae.zip
Teach GRExprEngine::VisitLValue() about FloatingLiteral, ImaginaryLiteral, and CharacterLiteral. Fixes an assertion failure reported in PR 7675.
llvm-svn: 109719
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/misc-ps-region-store.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps-region-store.cpp b/clang/test/Analysis/misc-ps-region-store.cpp
index 6794d481d68..baaa2f6cbd0 100644
--- a/clang/test/Analysis/misc-ps-region-store.cpp
+++ b/clang/test/Analysis/misc-ps-region-store.cpp
@@ -132,3 +132,19 @@ int TestHandleThis::null_deref_positive() {
return 0;
}
+// PR 7675 - passing literals by-reference
+void pr7675(const double &a);
+void pr7675(const int &a);
+void pr7675(const char &a);
+void pr7675_i(const _Complex double &a);
+
+void pr7675_test() {
+ pr7675(10.0);
+ pr7675(10);
+ pr7675('c');
+ pr7675_i(4.0i);
+ // Add null deref to ensure we are analyzing the code up to this point.
+ int *p = 0;
+ *p = 0xDEADBEEF; // expected-warning{{null pointer}}
+}
+
OpenPOWER on IntegriCloud