(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
missing-header-fixit-3.c
       1  /* Example of a fix-it hint that adds a #include directive,
       2     adding them to the top of the file, given that there is no
       3     pre-existing #include.  */
       4  
       5  /* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -Wno-implicit-function-declaration" } */
       6  
       7  void test (int i, int j)
       8  {
       9    printf ("%i of %i\n", i, j); /* { dg-warning "implicit declaration" } */
      10    /* { dg-message "include '<stdio.h>' or provide a declaration of 'printf'" "" { target *-*-* } 1 } */
      11  #if 0
      12  /* { dg-begin-multiline-output "" }
      13      9 |   printf ("%i of %i\n", i, j);
      14        |   ^~~~~~
      15     { dg-end-multiline-output "" } */
      16  /* { dg-begin-multiline-output "" }
      17    +++ |+#include <stdio.h>
      18      1 | /* Example of a fix-it hint that adds a #include directive,
      19     { dg-end-multiline-output "" } */
      20  #endif
      21  }