Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / missing-header-fixit-4.c
blob942897d8c79fd6a615b1ab367cec10f54e55db32
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-warning "incompatible implicit declaration" "" { target *-*-* } printf } */
13 /* { dg-begin-multiline-output "" }
14 10 | printf ("%i of %i\n", i, j);
15 | ^~~~~~
16 { dg-end-multiline-output "" } */
17 /* { dg-message "include '<stdio.h>' or provide a declaration of 'printf'" "" { target *-*-* } 4 } */
18 /* { dg-begin-multiline-output "" }
19 3 | #include "empty.h"
20 +++ |+#include <stdio.h>
21 4 | int the_next_line;
22 { dg-end-multiline-output "" } */