From 36c49e3f258dced101949edabd72e9bc3f1dedc4 Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 17 Sep 2010 15:54:40 +0000 Subject: Vendor import of clang r114020 (from the release_28 branch): http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor) --- test/Analysis/misc-ps-region-store.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/Analysis/misc-ps-region-store.cpp') diff --git a/test/Analysis/misc-ps-region-store.cpp b/test/Analysis/misc-ps-region-store.cpp index 6794d48..bfa5e5c 100644 --- a/test/Analysis/misc-ps-region-store.cpp +++ b/test/Analysis/misc-ps-region-store.cpp @@ -132,3 +132,30 @@ 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}} +} + +// - CFGBuilder should handle temporaries. +struct R8375510 { + R8375510(); + ~R8375510(); + R8375510 operator++(int); +}; + +int r8375510(R8375510 x, R8375510 y) { + for (; ; x++) { } +} + -- cgit v1.1