aboutsummaryrefslogtreecommitdiff
path: root/clang/test/Analysis/array-struct-region.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-03Reland 4: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen1-1/+1
constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296895
2017-03-02Revert "Reland 3: [analyzer] NFC: Update test infrastructure to support ↵Dominic Chen1-1/+1
multiple constraint managers" This reverts commit ea36f1406e1f36bf456c3f3929839b024128e468. llvm-svn: 296841
2017-03-02Reland 3: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen1-1/+1
constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296837
2017-03-02Revert "Reland 2: [analyzer] NFC: Update test infrastructure to support ↵Dominic Chen1-1/+1
multiple constraint managers" This reverts commit f93343c099fff646a2314cc7f4925833708298b1. llvm-svn: 296836
2017-03-02Reland 2: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen1-1/+1
constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296835
2017-02-28Revert "Reland: [analyzer] NFC: Update test infrastructure to support ↵Dominic Chen1-1/+1
multiple constraint managers" This reverts commit 1b28d0b10e1c8feccb971abb6ef7a18bee589830. llvm-svn: 296422
2017-02-28Reland: [analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen1-1/+1
constraint managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296414
2017-02-27Revert "[analyzer] NFC: Update test infrastructure to support multiple ↵Dominic Chen1-1/+1
constraint managers" This reverts commit 8e7780b9e59ddaad1800baf533058d2c064d4787. llvm-svn: 296317
2017-02-27[analyzer] NFC: Update test infrastructure to support multiple constraint ↵Dominic Chen1-1/+1
managers Summary: Replace calls to %clang/%clang_cc1 with %clang_analyze_cc1 when invoking static analyzer, and perform runtime substitution to select the appropriate constraint manager, per D28952. Reviewers: xazax.hun, NoQ, zaks.anna, dcoughlin Subscribers: mgorny, rgov, mikhail.ramalho, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D30373 llvm-svn: 296312
2016-12-01[analyzer] Drop explicit mention of range constraint solverDominic Chen1-1/+1
Summary: The basic constraint solver was dropped in rL162384, leaving the range constraint solver as the default and only constraint solver. Explicitly specifying it is unnecessary, and makes it difficult to test with other solver backends. Reviewers: zaks.anna, dcoughlin Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26694 llvm-svn: 288372
2013-02-21[analyzer] Tighten up safety in the use of lazy bindings.Jordan Rose1-0/+7
- When deciding if we can reuse a lazy binding, make sure to check if there are additional bindings in the sub-region. - When reading from a lazy binding, don't accidentally strip off casts or base object regions. This slows down lazy binding reading a bit but is necessary for type sanity when treating one class as another. A bit of minor refactoring allowed these two checks to be unified in a nice early-return-using helper function. <rdar://problem/13239840> llvm-svn: 175703
2013-02-01[analyzer] Reuse a LazyCompoundVal if its type matches the new region.Jordan Rose1-0/+44
This allows us to keep from chaining LazyCompoundVals in cases like this: CGRect r = CGRectMake(0, 0, 640, 480); CGRect r2 = r; CGRect r3 = r2; Previously we only made this optimization if the struct did not begin with an aggregate member, to make sure that we weren't picking up an LCV for the first field of the struct. But since LazyCompoundVals are typed, we can make that inference directly by comparing types. This is a pure optimization; the test changes are to guard against possible future regressions. llvm-svn: 174211
2013-01-31[analyzer] Fix a bug in region store that lead to undefined value falseAnna Zaks1-1/+13
positives. The includeSuffix was only set on the first iteration through the function, resulting in invalid regions being produced by getLazyBinding (ex: zoomRegion.y). llvm-svn: 174016
2012-11-10[analyzer] When invalidating symbolic offset regions, take fields into account.Jordan Rose1-0/+107
Previously, RegionStore was being VERY conservative in saying that because p[i].x and p[i].y have a concrete base region of 'p', they might overlap. Now, we check the chain of fields back up to the base object and check if they match. This only kicks in when dealing with symbolic offset regions because RegionStore's "base+offset" representation of concrete offset regions loses all information about fields. In cases where all offsets are concrete (s.x and s.y), RegionStore will already do the right thing, but mixing concrete and symbolic offsets can cause bindings to be invalidated that are known to not overlap (e.g. p[0].x and p[i].y). This additional refinement is tracked by <rdar://problem/12676180>. <rdar://problem/12530149> llvm-svn: 167654
2012-08-24Fix analyzer tests.Ted Kremenek1-1/+1
llvm-svn: 162588
2012-08-22Remove BasicConstraintManager. It hasn't been in active service for a while.Ted Kremenek1-1/+0
As part of this change, I discovered that a few of our tests were not testing the RangeConstraintManager. Luckily all of those passed when I moved them over to use that constraint manager. llvm-svn: 162384
2012-08-21[analyzer] -analyzer-ipa=inlining is now the default. Remove it from tests.Jordan Rose1-2/+2
The actual change here is a little more complicated than the summary above. What we want to do is have our generic inlining tests run under whatever mode is the default. However, there are some tests that depend on the presence of C++ inlining, which still has some rough edges. These tests have been explicitly marked as -analyzer-ipa=inlining in preparation for a new mode that limits inlining to C functions and blocks. This will be the default until the false positives for C++ have been brought down to manageable levels. llvm-svn: 162317
2012-08-08[analyzer] Revamp RegionStore to distinguish regions with symbolic offsets.Jordan Rose1-0/+92
RegionStore currently uses a (Region, Offset) pair to describe the locations of memory bindings. However, this representation breaks down when we have regions like 'array[index]', where 'index' is unknown. We used to store this as (SubRegion, 0); now we mark them specially as (SubRegion, SYMBOLIC). Furthermore, ProgramState::scanReachableSymbols depended on the existence of a sub-region map, but RegionStore's implementation doesn't provide for such a thing. Moving the store-traversing logic of scanReachableSymbols into the StoreManager allows us to eliminate the notion of SubRegionMap altogether. This fixes some particularly awkward broken test cases, now in array-struct-region.c. llvm-svn: 161510
2012-07-06[analyzer] Fix mis-committed test. No functionality change.Jordan Rose1-2/+2
llvm-svn: 159869
2012-07-06[analyzer] Be careful about LazyCompoundVals, which may be for the first field.Jordan Rose1-2/+37
We use LazyCompoundVals to avoid copying the contents of structs and arrays around in the store, and when we need to pass a struct around that already has a LazyCompoundVal we just use the original one. However, it's possible that the first field of a struct may have a LazyCompoundVal of its own, and we currently can't distinguish a LazyCompoundVal for the first element of a struct from a LazyCompoundVal for the entire struct. In this case we should just drop the optimization and make a new LazyCompoundVal that encompasses the old one. PR13264 / <rdar://problem/11802440> llvm-svn: 159866
2012-05-16[analyzer] Convert many existing tests to use clang_analyzer_eval.Jordy Rose1-19/+18
llvm-svn: 156920
2012-05-15Improve some of the conversion warnings to fire on conversion to bool.David Blaikie1-2/+2
Moves the bool bail-out down a little in SemaChecking - so now -Wnull-conversion and -Wliteral-conversion can fire when the target type is bool. Also improve the wording/details in the -Wliteral-conversion warning to match the -Wconstant-conversion. llvm-svn: 156826
2012-05-12[analyzer] Test case: p->x is the same as p[0].x. (PR7297)Jordy Rose1-0/+13
llvm-svn: 156720
2012-04-05Enable warn_impcast_literal_float_to_integer by default.David Blaikie1-2/+2
This diagnostic seems to be production ready, it's just an oversight that it wasn't turned on by default. The test changes are a bit of a mixed bag. Some tests that seemed like they clearly didn't need to use this behavior have been modified not to use it. Others that I couldn't be sure about, I added the necessary expected-warnings to. It's possible the diagnostic message could be improved to make it clearer that this warning can be suppressed by using a value that won't lose precision when converted to the target type (but can still be a floating point literal, such as "bool b = 1.0;"). llvm-svn: 154068
2011-08-03[analyzer] rename all experimental checker packages to have 'experimental' ↵Ted Kremenek1-2/+2
be the common root package. llvm-svn: 136835
2011-03-24Rework checker "packages" and groups to be more hierarchical.Ted Kremenek1-2/+2
llvm-svn: 128187
2011-02-28[analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best ↵Argyrios Kyrtzidis1-2/+2
misnomer award. llvm-svn: 126676
2011-02-28[analyzer] Remove '-analyzer-experimental-checks' flag.Argyrios Kyrtzidis1-2/+2
llvm-svn: 126607
2011-02-24[analyzer] Remove '-analyzer-experimental-internal-checks' flag, it doesn't ↵Argyrios Kyrtzidis1-2/+2
have any checkers associated with it anymore. llvm-svn: 126440
2011-02-15[analyzer] Use the new registration mechanism on some of the experimental ↵Argyrios Kyrtzidis1-2/+2
checks. These are: CStringChecker ChrootChecker MallocChecker PthreadLockChecker StreamChecker UnreachableCodeChecker MallocChecker creates implicit dependencies between checkers and needs to be handled differently. llvm-svn: 125598
2010-08-20Handle nested compound values in BindArray for multidimensional arrays. ↵Jordy Rose1-0/+22
Fixes PR7945. llvm-svn: 111602
2010-07-29Move new test (that requires RegionStore) into its own file.Jordy Rose1-0/+25
llvm-svn: 109736