aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis
AgeCommit message (Collapse)Author
2009-11-17Drop unnecessary #include.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89154 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Use -fblocks and -fobjc-nonfragile-abi when that is what is being tested, ↵Daniel Dunbar
instead of forcing the triple. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Add PreVisitReturn to Malloc checker. Now we can recognize returned memoryZhongxing Xu
block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Don't #include <stdio.h> when tests don't need it, or use clang instead of ↵Daniel Dunbar
clang-cc when they do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Add EvalEndPath interface to Checker. Now we can check memory leaked at theZhongxing Xu
end of the path. Need to unify interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Add newline at the end of the file.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Add test to verify that the analyzer plist output is what we expect.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16Handle case of missing '@end' in implementation contextFariborz Jahanian
gracefully, on par with gcc, by: Issuing a warning, doing final sematinc check of its definitions and generating its meta-data. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88934 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14Fix a couple of tests.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88756 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Remove test case's dependency on header file.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Add two new test cases for the Malloc/Free checker. Both have to do withTed Kremenek
storing malloc'ed memory to global storage. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Add test case that shows a leak we don't catch.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Add clang-cc option "--analyzer-experimental-internal-checks". ThisTed Kremenek
option enables new "internal" checks that will eventually be turned on by default but still require broader testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Malloc checker basically works now.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11Split buffer overflow test case into two test cases, removing out logic that ↵Ted Kremenek
was commented out. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11Add undefined array subscript checker.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86837 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11Reimplement out-of-bound array access checker with the new checker interface.Zhongxing Xu
Now only one test case is XFAIL'ed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11CastToStructChecker: use 'isStructureType()' instead of 'isRecordType()' to ↵Ted Kremenek
determine if a pointer is casted to a struct pointer. This fixes an observed false positive when a value is casted to a union. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10Add test case for PointerSubChecker.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10Refine PointerSubChecker: compare the base region instead of the original Zhongxing Xu
region, so that arithmetic within a memory chunk is allowed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09update test case.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09Add check for pointer arithmetic on non-array variables.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09Add check for obsolete function call of getpw().Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09Add checker for CWE-588: Attempt to Access Child of a Non-structure Pointer.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09Add checker for CWE-587: Assignment of a Fixed Address to a Pointer.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09Add checker for CWE-469: Use of Pointer Subtraction to Determine Size. ThisZhongxing Xu
checker does not build sink nodes. Because svaluator computes an unknown value for the subtraction now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09Add a test case for CWE-467, and simplify the wording of the warning.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-08Eliminate &&s in tests.Daniel Dunbar
- 'for i in $(find . -type f); do sed -e 's#\(RUN:.*[^ ]\) *&& *$#\1#g' $i | FileUpdate $i; done', for the curious. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-07Implement -Wconversion. Off by default, in the non-gcc group. There'sJohn McCall
significant work left to be done to reduce the false-positive rate here. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06testing: Merge PR3135.c into misc-ps-region-store.m.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06Sentence-case bug type, and pull tests from region-only-test.c into ↵Ted Kremenek
misc-ps-region.store.m (removing an extra unneeded test file). Also add a bunch of FIXME comments for future enhancements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06add test case for PR3135 which was already fixedNuno Lopes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06Add a checker for CWE-466: Return of Pointer Value Outside of Expected Range.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05Tweak wording and classifications of analyzer diagnostics.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04Catch uses of undefined values when they are used in assignment, thus ↵Ted Kremenek
catching such bugs closer to the source. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03Pull VLA size checker into its own files. Zhongxing Xu
Split it to two checkers, one for undefined size, the other for zero size, so that we don't need to query the size when emitting the bug report. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85895 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03Implement: <rdar://problem/6250216> Warn against using -[NSAutoreleasePool ↵Ted Kremenek
release] in GC mode git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85887 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03Switch XFAIL format to match LLVM.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85880 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03retain/release checker: CGBitmapContextCreateWithData() returns an owned object.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85867 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03retain/release checker: Add special handling of CGBitmapContextCreateWithData().Ted Kremenek
Fixes: <rdar://problem/7358899> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85864 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30Handle loading of field values from LazyCompoundVals in ↵Ted Kremenek
GRExprEngine::VisitMemberExpr(). This fixes the crash reported in PR 5316. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29Fix accidental use of CheckSVal instead of CheckLocation, and add aTed Kremenek
small test case to show we handle dereferences of undefined values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29Fix an insidious bug in RegionStore::RemoveDeadBindings() pointed outTed Kremenek
by Zhongxing Xu. RemoveDeadBindings() would falsely prune SymbolicRegions from the store that wrapped derived symbols whose liveness could only be determined after scanning the store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29Add test case for <rdar://problem/7342806>.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28Unused ivars checker: also check methods in categories that are defined in ↵Ted Kremenek
the same translation unit. Fixes <rdar://problem/6260004>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27Add test cases for <rdar://problem/7332673>.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20RegionStore: Use the *default* binding (instead of the *direct* binding) of ↵Ted Kremenek
an Objective-C object region when doing lazy value retrieval of an ivar. This fixes: <rdar://problem/7312221> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-20retain/release checker: allow 'new', 'copy', 'alloc', 'init' prefix to start ↵Ted Kremenek
before '_' when determining Cocoa fundamental rule. Fixes: <rdar://problem/7265711> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17Fix another static analyzer crash due to a corner case in "folding" symbolic ↵Ted Kremenek
values that are constrained to be a constant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16Fix static analyzer crash due to recently add symbolic-value constant ↵Ted Kremenek
folding. The issue was falsely converting the constant value of the LHS of a '<<'/'>>' operation to the same APSInt value of the RHS. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84269 91177308-0d34-0410-b5e6-96231b3b80d8