Dominic Chen | 184c624 | 2017-03-03 18:02:02 +0000 | [diff] [blame] | 1 | // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -verify %s |
| 2 | // RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-output=text -analyzer-config prune-paths=false -DNPRUNE=1 -verify %s |
Jordan Rose | 329bbe8 | 2013-01-26 01:28:15 +0000 | [diff] [blame] | 3 | |
| 4 | // "prune-paths" is a debug option only; this is just a simple test to see that |
| 5 | // it's being honored. |
| 6 | |
| 7 | void helper() { |
| 8 | extern void foo(); |
| 9 | foo(); |
| 10 | } |
| 11 | |
| 12 | void test() { |
| 13 | helper(); |
| 14 | #if NPRUNE |
| 15 | // expected-note@-2 {{Calling 'helper'}} |
| 16 | // expected-note@-3 {{Returning from 'helper'}} |
| 17 | #endif |
| 18 | |
| 19 | *(volatile int *)0 = 1; // expected-warning {{Dereference of null pointer}} |
| 20 | // expected-note@-1 {{Dereference of null pointer}} |
| 21 | } |