| 1 |
/* This is padding (to avoid the generated patch containing DejaGnu |
| 2 |
directives). */ |
| 3 |
|
| 4 |
/* { dg-options "-fdiagnostics-generate-patch" } */ |
| 5 |
|
| 6 |
void test() |
| 7 |
{ |
| 8 |
typeid(void); // { dg-error "must '#include <typeinfo>' before using 'typeid'" } |
| 9 |
} |
| 10 |
|
| 11 |
/* Verify the output from -fdiagnostics-generate-patch. |
| 12 |
We expect the patch to begin with a header, containing this |
| 13 |
source filename, via an absolute path. |
| 14 |
Given the path, we can only capture it via regexps. */ |
| 15 |
/* { dg-regexp "\\-\\-\\- .*" } */ |
| 16 |
/* { dg-regexp "\\+\\+\\+ .*" } */ |
| 17 |
/* Use #if 0/#endif rather than comments, to allow the text to contain |
| 18 |
a comment. */ |
| 19 |
#if 0 |
| 20 |
{ dg-begin-multiline-output "" } |
| 21 |
@@ -1,3 +1,4 @@ |
| 22 |
+#include <typeinfo> |
| 23 |
/* This is padding (to avoid the generated patch containing DejaGnu |
| 24 |
directives). */ |
| 25 |
|
| 26 |
{ dg-end-multiline-output "" } |
| 27 |
#endif |