[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
diff --git a/test/Analysis/inlining/path-notes.c b/test/Analysis/inlining/path-notes.c
new file mode 100644
index 0000000..1db3c5a
--- /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