Testsuite: fix analyzer tests on Darwin
[official-gcc.git] / gcc / testsuite / gcc.dg / analyzer / inlining-7-multiline.c
blob956c6b90bb0715cba9a63b1e7d91a01ccb163218
1 /* As per inlining-7.c, but testing how the ASCII art version of
2 the path looks. */
4 /* { dg-additional-options "-O2 -fdiagnostics-show-path-depths" } */
5 /* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
7 static inline void
8 depth_6 (void *p)
10 __builtin_free (p); /* { dg-warning "double-'free' of 'p1'" "warning" } */
13 static inline void
14 depth_5 (void *p5)
16 depth_6 (p5);
19 static inline void
20 depth_4 (void *p4)
22 depth_5 (p4);
25 static inline void
26 depth_3 (void *p3)
28 depth_4 (p3);
29 depth_4 (p3);
32 static inline void
33 depth_2 (void *p2)
35 depth_3 (p2);
38 void
39 depth_1 (void *p1)
41 depth_2 (p1);
44 /* We want the reconstructed call/return hierarchy to show
45 that two calls happen at depth_3, without popping the stack
46 back any further. */
48 /* { dg-begin-multiline-output "" }
49 __builtin_free (p);
50 ^~~~~~~~~~~~~~~~~~
51 'depth_1': events 1-2 (depth 1)
53 | depth_1 (void *p1)
54 | ^~~~~~~
55 | |
56 | (1) entry to 'depth_1'
58 | depth_2 (p1);
59 | ~
60 | |
61 | (2) inlined call to 'depth_2' from 'depth_1'
63 +--> 'depth_2': event 3 (depth 2)
65 | depth_3 (p2);
66 | ^
67 | |
68 | (3) inlined call to 'depth_3' from 'depth_2'
70 +--> 'depth_3': event 4 (depth 3)
72 | depth_4 (p3);
73 | ^
74 | |
75 | (4) inlined call to 'depth_4' from 'depth_3'
77 +--> 'depth_4': event 5 (depth 4)
79 | depth_5 (p4);
80 | ^
81 | |
82 | (5) inlined call to 'depth_5' from 'depth_4'
84 +--> 'depth_5': event 6 (depth 5)
86 | depth_6 (p5);
87 | ^
88 | |
89 | (6) inlined call to 'depth_6' from 'depth_5'
91 +--> 'depth_6': event 7 (depth 6)
93 | __builtin_free (p);
94 | ^~~~~~~~~~~~~~~~~~
95 | |
96 | (7) first 'free' here
98 <--------------------+
100 'depth_3': event 8 (depth 3)
102 | depth_4 (p3);
105 | (8) inlined call to 'depth_4' from 'depth_3'
107 +--> 'depth_4': event 9 (depth 4)
109 | depth_5 (p4);
112 | (9) inlined call to 'depth_5' from 'depth_4'
114 +--> 'depth_5': event 10 (depth 5)
116 | depth_6 (p5);
119 | (10) inlined call to 'depth_6' from 'depth_5'
121 +--> 'depth_6': event 11 (depth 6)
123 | __builtin_free (p);
124 | ^~~~~~~~~~~~~~~~~~
126 | (11) second 'free' here; first 'free' was at (7)
128 { dg-end-multiline-output "" } */