1 /* Verify that when we suggest adding #include directives that they
2 are added to the affected file. */
4 /* The following header file is missing a "#include <stdio.h>". */
6 #include "missing-header-fixit-2.h"
8 /* These directives actually apply to the header. */
9 /* { dg-warning "implicit declaration of function 'printf'" "" { target *-*-* } 6 } */
10 /* { dg-warning "incompatible implicit declaration of built-in function 'printf'" "" { target *-*-* } 6 } */
12 /* { dg-options "-fdiagnostics-generate-patch" } */
14 /* Verify the output from -fdiagnostics-generate-patch.
15 We expect the patch to begin with a header, containing the
16 filename of the header, via an absolute path.
17 Given the path, we can only capture it via regexps. */
18 /* { dg-regexp "\\-\\-\\- .*" } */
19 /* { dg-regexp "\\+\\+\\+ .*" } */
20 /* Use #if 0/#endif rather than comments, to allow the text to contain
22 We expect the *header* to have been patched, adding the missing include. */
24 { dg
-begin
-multiline
-output
"" }
27 /* This is missing-header-fixit-2.h, for use by
28 missing-header-fixit-2.c */
30 { dg
-end
-multiline
-output
"" }