Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.dg / missing-header-fixit-5.c
blob916033c689c90dcc8597a7a5bfa5f55e029d771d
2 /* Forget to include any standard headers, all for built-in functions.
3 Rely on -Wimplicit-function-declaration for fixit hints, not on
4 -Wbuiltin-declaration-mismatch (which misses abs, isdigit, putchar). */
6 /* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -Wimplicit-function-declaration -Wno-builtin-declaration-mismatch" } */
8 int
9 foo (char *m, int i)
11 if (isdigit (m[0])) /* { dg-warning "implicit declaration of function" } */
12 /* { dg-begin-multiline-output "" }
13 11 | if (isdigit (m[0]))
14 | ^~~~~~~
15 +++ |+#include <ctype.h>
16 1 |
17 { dg-end-multiline-output "" } */
19 return abs (i); /* { dg-warning "implicit declaration of function" } */
20 /* { dg-begin-multiline-output "" }
21 19 | return abs (i);
22 | ^~~
23 +++ |+#include <stdlib.h>
24 1 |
25 { dg-end-multiline-output "" } */
27 else
28 putchar (m[0]); /* { dg-warning "implicit declaration of function" } */
29 /* { dg-begin-multiline-output "" }
30 28 | putchar (m[0]);
31 | ^~~~~~~
32 +++ |+#include <stdio.h>
33 1 |
34 { dg-end-multiline-output "" } */
35 return i;