diff options
-rw-r--r-- | test/Analysis/null-deref-ps.c | 9 | ||||
-rw-r--r-- | test/Analysis/region-only-test.c | 13 |
2 files changed, 13 insertions, 9 deletions
diff --git a/test/Analysis/null-deref-ps.c b/test/Analysis/null-deref-ps.c index 0c23690d45..6daedf0f93 100644 --- a/test/Analysis/null-deref-ps.c +++ b/test/Analysis/null-deref-ps.c @@ -212,12 +212,3 @@ void f12(HF12ITEM i, char *q) { *p = 1; // no-warning } -// Exercise ElementRegion with SymbolicRegion as super region. -void foo(int* p) { - int *x; - int a; - if (p[0] == 1) - x = &a; - if (p[0] == 1) - *x; // no-warning -} diff --git a/test/Analysis/region-only-test.c b/test/Analysis/region-only-test.c new file mode 100644 index 0000000000..0eabb7b888 --- /dev/null +++ b/test/Analysis/region-only-test.c @@ -0,0 +1,13 @@ +// RUN: clang -analyze -checker-simple -analyzer-store-region -verify %s + +// Region store must be enabled for tests in this file. + +// Exercise creating ElementRegion with symbolic super region. +void foo(int* p) { + int *x; + int a; + if (p[0] == 1) + x = &a; + if (p[0] == 1) + *x; // no-warning +} |