(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
inlining-7-multiline.c
       1  /* As per inlining-7.c, but testing how the ASCII art version of
       2     the path looks.  */
       3  
       4  /* { dg-additional-options "-O2 -fdiagnostics-show-path-depths" } */
       5  /* { dg-additional-options "-fdiagnostics-path-format=inline-events -fdiagnostics-show-caret" } */
       6  
       7  static inline void
       8  depth_6 (void *p)
       9  {
      10    __builtin_free (p); /* { dg-warning "double-'free' of 'p1'" "warning" } */
      11  }
      12  
      13  static inline void
      14  depth_5 (void *p5)
      15  {
      16    depth_6 (p5);
      17  }
      18  
      19  static inline void
      20  depth_4 (void *p4)
      21  {
      22    depth_5 (p4);
      23  }
      24  
      25  static inline void
      26  depth_3 (void *p3)
      27  {
      28    depth_4 (p3);
      29    depth_4 (p3);
      30  }
      31  
      32  static inline void
      33  depth_2 (void *p2)
      34  {
      35    depth_3 (p2);
      36  }
      37  
      38  void
      39  depth_1 (void *p1)
      40  {
      41    depth_2 (p1);
      42  }
      43  
      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.  */
      47  
      48  /* { dg-begin-multiline-output "" }
      49     __builtin_free (p);
      50     ^~~~~~~~~~~~~~~~~~
      51    'depth_1': events 1-2 (depth 1)
      52      |
      53      | depth_1 (void *p1)
      54      | ^~~~~~~
      55      | |
      56      | (1) entry to 'depth_1'
      57      |
      58      |   depth_2 (p1);
      59      |   ~
      60      |   |
      61      |   (2) inlined call to 'depth_2' from 'depth_1'
      62      |
      63      +--> 'depth_2': event 3 (depth 2)
      64             |
      65             |   depth_3 (p2);
      66             |   ^
      67             |   |
      68             |   (3) inlined call to 'depth_3' from 'depth_2'
      69             |
      70             +--> 'depth_3': event 4 (depth 3)
      71                    |
      72                    |   depth_4 (p3);
      73                    |   ^
      74                    |   |
      75                    |   (4) inlined call to 'depth_4' from 'depth_3'
      76                    |
      77                    +--> 'depth_4': event 5 (depth 4)
      78                           |
      79                           |   depth_5 (p4);
      80                           |   ^
      81                           |   |
      82                           |   (5) inlined call to 'depth_5' from 'depth_4'
      83                           |
      84                           +--> 'depth_5': event 6 (depth 5)
      85                                  |
      86                                  |   depth_6 (p5);
      87                                  |   ^
      88                                  |   |
      89                                  |   (6) inlined call to 'depth_6' from 'depth_5'
      90                                  |
      91                                  +--> 'depth_6': event 7 (depth 6)
      92                                         |
      93                                         |   __builtin_free (p);
      94                                         |   ^~~~~~~~~~~~~~~~~~
      95                                         |   |
      96                                         |   (7) first 'free' here
      97                                         |
      98                    <--------------------+
      99                    |
     100                  'depth_3': event 8 (depth 3)
     101                    |
     102                    |   depth_4 (p3);
     103                    |   ^
     104                    |   |
     105                    |   (8) inlined call to 'depth_4' from 'depth_3'
     106                    |
     107                    +--> 'depth_4': event 9 (depth 4)
     108                           |
     109                           |   depth_5 (p4);
     110                           |   ^
     111                           |   |
     112                           |   (9) inlined call to 'depth_5' from 'depth_4'
     113                           |
     114                           +--> 'depth_5': event 10 (depth 5)
     115                                  |
     116                                  |   depth_6 (p5);
     117                                  |   ^
     118                                  |   |
     119                                  |   (10) inlined call to 'depth_6' from 'depth_5'
     120                                  |
     121                                  +--> 'depth_6': event 11 (depth 6)
     122                                         |
     123                                         |   __builtin_free (p);
     124                                         |   ^~~~~~~~~~~~~~~~~~
     125                                         |   |
     126                                         |   (11) second 'free' here; first 'free' was at (7)
     127                                         |
     128     { dg-end-multiline-output "" } */