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 } */
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)
18 NN | WRAPPED_FREE (ptr);
23 | NN | #define WRAPPED_FREE(PTR) free(PTR)
26 | | (1) first 'free' here
27 | NN | WRAPPED_FREE (ptr);
33 | NN | #define WRAPPED_FREE(PTR) free(PTR)
36 | | (2) second 'free' here; first 'free' was at (1)
37 | NN | WRAPPED_FREE (ptr);
40 { dg-end-multiline-output "" } */