diff options
author | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 20:06:09 +0000 |
---|---|---|
committer | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-05-29 20:06:09 +0000 |
commit | 4b0184b2d38e0c38da2c665257d516b1eb2b6175 (patch) | |
tree | a4085e391c56963141674aca736aacfd9f097454 /clang/test/Analysis/diagnostics/no-store-func-path-notes.c | |
parent | 68908c9017d7c07f2a83b5d3428d5d15523a656c (diff) | |
download | bcm5719-llvm-4b0184b2d38e0c38da2c665257d516b1eb2b6175.tar.gz bcm5719-llvm-4b0184b2d38e0c38da2c665257d516b1eb2b6175.zip |
[analyzer] ConditionBRVisitor: Enhance to write out more information
Summary:
Add extra messages to the bug report to inform the user why the analyzer
`Taking true/false branch`.
Reviewers: NoQ, george.karpenkov
Reviewed By: NoQ
Subscribers: gerazo, gsd, dkrupp, whisperity, baloghadamsoftware, xazax.hun,
eraman, szepet, a.sidorin, mikhail.ramalho, Szelethus,
donat.nagy, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D53076
llvm-svn: 362020
Diffstat (limited to 'clang/test/Analysis/diagnostics/no-store-func-path-notes.c')
-rw-r--r-- | clang/test/Analysis/diagnostics/no-store-func-path-notes.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/clang/test/Analysis/diagnostics/no-store-func-path-notes.c b/clang/test/Analysis/diagnostics/no-store-func-path-notes.c index c0208214cc3..fd0a90e85e2 100644 --- a/clang/test/Analysis/diagnostics/no-store-func-path-notes.c +++ b/clang/test/Analysis/diagnostics/no-store-func-path-notes.c @@ -5,7 +5,8 @@ typedef __typeof(sizeof(int)) size_t; void *memset(void *__s, int __c, size_t __n); int initializer1(int *p, int x) { - if (x) { // expected-note{{Taking false branch}} + if (x) { // expected-note{{'x' is 0}} + // expected-note@-1{{Taking false branch}} *p = 1; return 0; } else { @@ -30,7 +31,8 @@ int param_initialized_properly() { static int global; int initializer2(int **p, int x) { - if (x) { // expected-note{{Taking false branch}} + if (x) { // expected-note{{'x' is 0}} + // expected-note@-1{{Taking false branch}} *p = &global; return 0; } else { @@ -47,7 +49,8 @@ int param_not_written_into_by_func() { } void initializer3(int *p, int param) { - if (param) // expected-note{{Taking false branch}} + if (param) // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} *p = 0; } // expected-note{{Returning without writing to '*p'}} @@ -60,12 +63,14 @@ int param_written_into_by_void_func() { } void initializer4(int *p, int param) { - if (param) // expected-note{{Taking false branch}} + if (param) // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} *p = 0; } // expected-note{{Returning without writing to '*p'}} void initializer5(int *p, int param) { - if (!param) // expected-note{{Taking false branch}} + if (!param) // expected-note{{'param' is 1}} + // expected-note@-1{{Taking false branch}} *p = 0; } // expected-note{{Returning without writing to '*p'}} @@ -95,7 +100,8 @@ typedef struct { } S; int initializer7(S *s, int param) { - if (param) { // expected-note{{Taking false branch}} + if (param) { // expected-note{{'param' is 0}} + // expected-note@-1{{Taking false branch}} s->x = 0; return 0; } |