1  /* { dg-do compile } */
       2  /* { dg-options "-O -fdiagnostics-show-caret" } */
       3  
       4  /* This is an example file for use with
       5     diagnostic_plugin_show_trees.c.
       6  
       7     The plugin handles "__show_tree" by recursively dumping
       8     the internal structure of the second input argument.
       9  
      10     We want to accept an expression of any type.  To do this in C, we
      11     use variadic arguments, but C requires at least one argument before
      12     the ellipsis, so we have a dummy one.  */
      13  
      14  extern void __show_tree (int dummy, ...);
      15  
      16  extern double sqrt (double x);
      17  
      18  void test_quadratic (double a, double b, double c)
      19  {
      20    __show_tree (0,
      21       (-b + sqrt (b * b - 4 * a * c))
      22       / (2 * a));
      23  
      24  /* { dg-begin-multiline-output "" }
      25        (-b + sqrt (b * b - 4 * a * c))
      26        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      27        / (2 * a));
      28        ^~~~~~~~~
      29     { dg-end-multiline-output "" } */
      30  
      31  /* { dg-begin-multiline-output "" }
      32        (-b + sqrt (b * b - 4 * a * c))
      33        ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
      34     { dg-end-multiline-output "" } */
      35  
      36  /* { dg-begin-multiline-output "" }
      37        (-b + sqrt (b * b - 4 * a * c))
      38              ^~~~~~~~~~~~~~~~~~~~~~~~
      39     { dg-end-multiline-output "" } */
      40  
      41  /* { dg-begin-multiline-output "" }
      42        (-b + sqrt (b * b - 4 * a * c))
      43                    ~~~~~~^~~~~~~~~~~
      44     { dg-end-multiline-output "" } */
      45  
      46  /* { dg-begin-multiline-output "" }
      47        (-b + sqrt (b * b - 4 * a * c))
      48                    ~~^~~
      49     { dg-end-multiline-output "" } */
      50  
      51  /* { dg-begin-multiline-output "" }
      52        (-b + sqrt (b * b - 4 * a * c))
      53                            ~~~~~~^~~
      54     { dg-end-multiline-output "" } */
      55  
      56  /* { dg-begin-multiline-output "" }
      57        (-b + sqrt (b * b - 4 * a * c))
      58                            ~~^~~
      59     { dg-end-multiline-output "" } */
      60  
      61  /* { dg-begin-multiline-output "" }
      62        / (2 * a));
      63          ~~~^~~~
      64     { dg-end-multiline-output "" } */
      65  }