annotate gcc/testsuite/gcc.dg/missing-header-fixit-2.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Verify that when we suggest adding #include directives that they
kono
parents:
diff changeset
2 are added to the affected file. */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 /* The following header file is missing a "#include <stdio.h>". */
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #include "missing-header-fixit-2.h"
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 /* These directives actually apply to the header. */
kono
parents:
diff changeset
9 /* { dg-warning "implicit declaration of function 'printf'" "" { target *-*-* } 6 } */
kono
parents:
diff changeset
10 /* { dg-warning "incompatible implicit declaration of built-in function 'printf'" "" { target *-*-* } 6 } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 /* { dg-options "-fdiagnostics-generate-patch" } */
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 /* Verify the output from -fdiagnostics-generate-patch.
kono
parents:
diff changeset
15 We expect the patch to begin with a header, containing the
kono
parents:
diff changeset
16 filename of the header, via an absolute path.
kono
parents:
diff changeset
17 Given the path, we can only capture it via regexps. */
kono
parents:
diff changeset
18 /* { dg-regexp "\\-\\-\\- .*" } */
kono
parents:
diff changeset
19 /* { dg-regexp "\\+\\+\\+ .*" } */
kono
parents:
diff changeset
20 /* Use #if 0/#endif rather than comments, to allow the text to contain
kono
parents:
diff changeset
21 a comment.
kono
parents:
diff changeset
22 We expect the *header* to have been patched, adding the missing include. */
kono
parents:
diff changeset
23 #if 0
kono
parents:
diff changeset
24 { dg-begin-multiline-output "" }
kono
parents:
diff changeset
25 @@ -1,3 +1,4 @@
kono
parents:
diff changeset
26 +#include <stdio.h>
kono
parents:
diff changeset
27 /* This is missing-header-fixit-2.h, for use by
kono
parents:
diff changeset
28 missing-header-fixit-2.c */
kono
parents:
diff changeset
29
kono
parents:
diff changeset
30 { dg-end-multiline-output "" }
kono
parents:
diff changeset
31 #endif