Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git] / gcc / testsuite / c-c++-common / analyzer / malloc-macro-inline-events.c
blob8e71c4144cd0d8fcb4e4d8979837bdc3325fbc47
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-skip-if "requires hosted libstdc++ for stdlib free" { ! hostedlib } } */
5 /* { dg-enable-nn-line-numbers "" } */
7 #include "malloc-macro.h"
9 /* { dg-warning "double-'free' of 'ptr'" "" { target *-*-* } 2 } */
11 void test (void *ptr)
13 WRAPPED_FREE (ptr); /* { dg-message "in expansion of macro 'WRAPPED_FREE'" } */
14 WRAPPED_FREE (ptr); /* { dg-message "in expansion of macro 'WRAPPED_FREE'" } */
16 /* { dg-begin-multiline-output "" }
17 NN | #define WRAPPED_FREE(PTR) free(PTR)
18 | ^~~~~~~~~
19 NN | WRAPPED_FREE (ptr);
20 | ^~~~~~~~~~~~
21 { dg-end-multiline-output "" { target c } } */
22 /* { dg-begin-multiline-output "" }
23 NN | #define WRAPPED_FREE(PTR) free(PTR)
24 | ~~~~^~~~~
25 NN | WRAPPED_FREE (ptr);
26 | ^~~~~~~~~~~~
27 { dg-end-multiline-output "" { target c++ } } */
28 /* { dg-begin-multiline-output "" }
29 'test': event 1
30 { dg-end-multiline-output "" { target c } } */
31 /* { dg-begin-multiline-output "" }
32 'void test(void*)': event 1
33 { dg-end-multiline-output "" { target c++ } } */
34 /* { dg-prune-output "\[^\n\r\]*malloc-macro.h\[^\n\r\]*" } */
35 /* { dg-begin-multiline-output "" }
36 NN | #define WRAPPED_FREE(PTR) free(PTR)
37 | ^~~~~~~~~
38 | |
39 | (1) first 'free' here
40 NN | WRAPPED_FREE (ptr);
41 | ^~~~~~~~~~~~
42 { dg-end-multiline-output "" { target c } } */
43 /* { dg-begin-multiline-output "" }
44 NN | #define WRAPPED_FREE(PTR) free(PTR)
45 | ~~~~^~~~~
46 | |
47 | (1) first 'free' here
48 NN | WRAPPED_FREE (ptr);
49 | ^~~~~~~~~~~~
50 { dg-end-multiline-output "" { target c++ } } */
51 /* { dg-prune-output "\[^\n\r\]*malloc-macro.h\[^\n\r\]*" } */
52 /* { dg-begin-multiline-output "" }
53 'test': event 2
54 { dg-end-multiline-output "" { target c } } */
55 /* { dg-begin-multiline-output "" }
56 'void test(void*)': event 2
57 { dg-end-multiline-output "" { target c++ } } */
58 /* { dg-prune-output "\[^\n\r\]*malloc-macro.h\[^\n\r\]*" } */
59 /* { dg-begin-multiline-output "" }
60 NN | #define WRAPPED_FREE(PTR) free(PTR)
61 | ^~~~~~~~~
62 | |
63 | (2) second 'free' here; first 'free' was at (1)
64 NN | WRAPPED_FREE (ptr);
65 | ^~~~~~~~~~~~
66 { dg-end-multiline-output "" { target c } } */
67 /* { dg-begin-multiline-output "" }
68 NN | #define WRAPPED_FREE(PTR) free(PTR)
69 | ~~~~^~~~~
70 | |
71 | (2) second 'free' here; first 'free' was at (1)
72 NN | WRAPPED_FREE (ptr);
73 | ^~~~~~~~~~~~
74 { dg-end-multiline-output "" { target c++ } } */