libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / plugin / diagnostic-test-show-trees-1.c
blob7473a07961f2d4811b8eadc0b5081330598545ed
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)
20 __show_tree (0,
21 (-b + sqrt (b * b - 4 * a * c))
22 / (2 * a));
24 /* { dg-begin-multiline-output "" }
25 (-b + sqrt (b * b - 4 * a * c))
26 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 / (2 * a));
28 ^~~~~~~~~
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))
43 ~~~~~~^~~~~~~~~~~
44 { dg-end-multiline-output "" } */
46 /* { dg-begin-multiline-output "" }
47 (-b + sqrt (b * b - 4 * a * c))
48 ~~^~~
49 { dg-end-multiline-output "" } */
51 /* { dg-begin-multiline-output "" }
52 (-b + sqrt (b * b - 4 * a * c))
53 ~~~~~~^~~
54 { dg-end-multiline-output "" } */
56 /* { dg-begin-multiline-output "" }
57 (-b + sqrt (b * b - 4 * a * c))
58 ~~^~~
59 { dg-end-multiline-output "" } */
61 /* { dg-begin-multiline-output "" }
62 / (2 * a));
63 ~~~^~~~
64 { dg-end-multiline-output "" } */