[cfe-commits] r127525 - in /cfe/trunk: lib/StaticAnalyzer/Checkers/CMakeLists.txt lib/StaticAnalyzer/Checkers/Checkers.td lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp test/Analysis/iterators.cpp

Ted Kremenek kremenek at apple.com
Tue Mar 29 14:42:08 PDT 2011


On Mar 29, 2011, at 1:30 PM, Chandler Carruth wrote:

> Sorry to dredge up an old thread, but I'm trying to get some policy clarification:
> 
> On Fri, Mar 11, 2011 at 6:49 PM, Ted Kremenek <kremenek at apple.com> wrote:
> Added: cfe/trunk/test/Analysis/iterators.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/iterators.cpp?rev=127525&view=auto
> ==============================================================================
> --- cfe/trunk/test/Analysis/iterators.cpp (added)
> +++ cfe/trunk/test/Analysis/iterators.cpp Fri Mar 11 20:49:15 2011
> @@ -0,0 +1,104 @@
> +// RUN: %clang_cc1 -analyze -analyzer-checker=core,core.experimental.Iterators -verify %s
> +
> +#include <vector>
> 
> I thought test cases were expected to be freestanding? Before this one, there were only two tests that violate that requirement. Thoughts?
> 
> For reference, we build and run all Clang and LLVM tests in a freestanding environment out of necessity, so we end up catching these.

The problem with making this freestanding is that it doesn't test that the checker works on a given platform.  The definitions of std::vector are allowed to vary, so having tests check against the local version actually helps us catch bugs in the checker.

The other problem with making this freestanding is that simply copying the required parts from <vector> may not be an option if we want to keep the test case free of GPL code (in the case of using the stdc++ provided with GCC).  We of course could use the definition from LLVM's libc++, but then we wouldn't again be testing against what the user is always using when they compile.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110329/40631763/attachment.html>


More information about the cfe-commits mailing list