diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-08-03 23:08:54 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-08-03 23:08:54 +0000 |
commit | b0e1badc2a9b8275b48dfb15c6907a282b949b02 (patch) | |
tree | 528a9bae79efb3eee7caefabcccb125ec810078f /test/Analysis | |
parent | 9da59a67a27a4d3fc9d59552f07808a32f85e9d3 (diff) |
[analyzer] Flatten path diagnostics for text output like we do for HTML.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis')
-rw-r--r-- | test/Analysis/inlining/path-notes.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Analysis/inlining/path-notes.c b/test/Analysis/inlining/path-notes.c new file mode 100644 index 0000000000..1db3c5aab8 --- /dev/null +++ b/test/Analysis/inlining/path-notes.c @@ -0,0 +1,14 @@ +// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-ipa=inlining -analyzer-output=text -verify %s + +void zero(int **p) { + *p = 0; + // expected-note@-1 {{Null pointer value stored to 'a'}} +} + +void testZero(int *a) { + zero(&a); + // expected-note@-1 {{Calling 'zero'}} + // expected-note@-2 {{Returning from 'zero'}} + *a = 1; // expected-warning{{Dereference of null pointer}} + // expected-note@-1 {{Dereference of null pointer (loaded from variable 'a')}} +}
\ No newline at end of file |