1 /* { dg-do compile } */
2 /* { dg-options "-O -fdiagnostics-show-caret" } */
4 /* This is an example file for use with
5 diagnostic_plugin_show_trees.c.
7 The plugin handles "__show_tree" by recursively dumping
8 the internal structure of the second input argument.
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. */
14 extern void __show_tree (int dummy
, ...);
16 extern double sqrt (double x
);
18 void test_quadratic (double a
, double b
, double c
)
21 (-b
+ sqrt (b
* b
- 4 * a
* c
))
24 /* { dg-begin-multiline-output "" }
25 (-b + sqrt (b * b - 4 * a * c))
26 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 { dg-end-multiline-output "" } */
31 /* { dg-begin-multiline-output "" }
32 (-b + sqrt (b * b - 4 * a * c))
33 ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
34 { dg-end-multiline-output "" } */
36 /* { dg-begin-multiline-output "" }
37 (-b + sqrt (b * b - 4 * a * c))
38 ^~~~~~~~~~~~~~~~~~~~~~~~
39 { dg-end-multiline-output "" } */
41 /* { dg-begin-multiline-output "" }
42 (-b + sqrt (b * b - 4 * a * c))
44 { dg-end-multiline-output "" } */
46 /* { dg-begin-multiline-output "" }
47 (-b + sqrt (b * b - 4 * a * c))
49 { dg-end-multiline-output "" } */
51 /* { dg-begin-multiline-output "" }
52 (-b + sqrt (b * b - 4 * a * c))
54 { dg-end-multiline-output "" } */
56 /* { dg-begin-multiline-output "" }
57 (-b + sqrt (b * b - 4 * a * c))
59 { dg-end-multiline-output "" } */
61 /* { dg-begin-multiline-output "" }
64 { dg-end-multiline-output "" } */