Require target lra in gcc.dg/pr108095.c
[official-gcc.git] / gcc / testsuite / gcc.dg / missing-header-fixit-4.c
blobb6680563dc13d89dc63ea447bfe3fd7fc173c268
1 /* Example of a fix-it hint that adds a #include directive,
2 adding them after a pre-existing #include directive. */
3 #include "empty.h"
4 int the_next_line;
6 /* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers" } */
8 void test (int i, int j)
10 printf ("%i of %i\n", i, j); /* { dg-line printf } */
11 /* { dg-warning "implicit declaration of function" "" { target *-*-* } printf } */
12 /* { dg-begin-multiline-output "" }
13 10 | printf ("%i of %i\n", i, j);
14 | ^~~~~~
15 { dg-end-multiline-output "" } */
16 /* { dg-warning "incompatible implicit declaration" "" { target *-*-* } printf } */
17 /* { dg-begin-multiline-output "" }
18 10 | printf ("%i of %i\n", i, j);
19 | ^~~~~~
20 { dg-end-multiline-output "" } */
21 /* { dg-message "include '<stdio.h>' or provide a declaration of 'printf'" "" { target *-*-* } 4 } */
22 /* { dg-begin-multiline-output "" }
23 3 | #include "empty.h"
24 +++ |+#include <stdio.h>
25 4 | int the_next_line;
26 { dg-end-multiline-output "" } */