Testsuite: fix analyzer tests on Darwin
[official-gcc.git] / gcc / testsuite / gcc.dg / analyzer / malloc-macro-inline-events.c
blob9134bb4781e5549f448889e498c3c2de062e185d
1 /* Test path-printing in the face of macros. */
3 /* { dg-additional-options "-fdiagnostics-show-line-numbers -fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
4 /* { dg-enable-nn-line-numbers "" } */
6 #include "malloc-macro.h"
8 /* { dg-warning "double-'free' of 'ptr'" "" { target *-*-* } 2 } */
10 int test (void *ptr)
12 WRAPPED_FREE (ptr); /* { dg-message "in expansion of macro 'WRAPPED_FREE'" } */
13 WRAPPED_FREE (ptr); /* { dg-message "in expansion of macro 'WRAPPED_FREE'" } */
15 /* { dg-begin-multiline-output "" }
16 NN | #define WRAPPED_FREE(PTR) free(PTR)
17 | ^~~~~~~~~
18 NN | WRAPPED_FREE (ptr);
19 | ^~~~~~~~~~~~
20 'test': event 1
23 | NN | #define WRAPPED_FREE(PTR) free(PTR)
24 | | ^~~~~~~~~
25 | | |
26 | | (1) first 'free' here
27 | NN | WRAPPED_FREE (ptr);
28 | | ^~~~~~~~~~~~
30 'test': event 2
33 | NN | #define WRAPPED_FREE(PTR) free(PTR)
34 | | ^~~~~~~~~
35 | | |
36 | | (2) second 'free' here; first 'free' was at (1)
37 | NN | WRAPPED_FREE (ptr);
38 | | ^~~~~~~~~~~~
40 { dg-end-multiline-output "" } */