diff options
Diffstat (limited to 'test/Analysis/diagnostics/no-prune-paths.c')
-rw-r--r-- | test/Analysis/diagnostics/no-prune-paths.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/Analysis/diagnostics/no-prune-paths.c b/test/Analysis/diagnostics/no-prune-paths.c new file mode 100644 index 0000000..fab5cf8 --- /dev/null +++ b/test/Analysis/diagnostics/no-prune-paths.c @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -verify %s +// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-output=text -analyzer-config prune-paths=false -DNPRUNE=1 -verify %s + +// "prune-paths" is a debug option only; this is just a simple test to see that +// it's being honored. + +void helper() { + extern void foo(); + foo(); +} + +void test() { + helper(); +#if NPRUNE + // expected-note@-2 {{Calling 'helper'}} + // expected-note@-3 {{Returning from 'helper'}} +#endif + + *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} + // expected-note@-1 {{Dereference of null pointer}} +} |