]>
Commit | Line | Data |
---|---|---|
5c6a2bf2 DM |
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 | ||
1c7bcefb | 5 | /* { dg-options "-fdiagnostics-show-caret -fdiagnostics-show-line-numbers -Wno-implicit-function-declaration" } */ |
5c6a2bf2 DM |
6 | |
7 | void test (int i, int j) | |
8 | { | |
9 | printf ("%i of %i\n", i, j); /* { dg-warning "implicit declaration" } */ | |
85204e23 | 10 | /* { dg-message "include '<stdio.h>' or provide a declaration of 'printf'" "" { target *-*-* } 1 } */ |
5c6a2bf2 DM |
11 | #if 0 |
12 | /* { dg-begin-multiline-output "" } | |
0141ab44 DM |
13 | 9 | printf ("%i of %i\n", i, j); |
14 | | ^~~~~~ | |
5c6a2bf2 | 15 | { dg-end-multiline-output "" } */ |
5c6a2bf2 | 16 | /* { dg-begin-multiline-output "" } |
0141ab44 DM |
17 | +++ |+#include <stdio.h> |
18 | 1 | /* Example of a fix-it hint that adds a #include directive, | |
5c6a2bf2 DM |
19 | { dg-end-multiline-output "" } */ |
20 | #endif | |
21 | } |