1 /* Copyright (C) 2001 Free Software Foundation, Inc.
2 Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com> */
4 /* Test of prohibition on directives which result from macro expansion.
7 /* { dg-do compile } */
10 #define HASHDEFINE #define
11 #define HASHINCLUDE #include
13 HASH include
"somerandomfile" /*{ dg-error "stray" "non-include" }*/
14 /*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 13 }*/
15 int resync_parser_1
; /*{ dg-error "parse|syntax|expected" "" { target *-*-* } 13 }*/
17 HASHINCLUDE
<somerandomfile
> /*{ dg-error "stray|expected" "non-include 2" }*/
18 /*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 17 }*/
23 HASH define X
1 /* { dg-error "stray|undeclared|parse|syntax|expected|for each" "# from macro" } */
29 HASHDEFINE Y
1 /* { dg-error "stray|undeclared|parse|syntax|expected|for each" "#define from macro" } */
33 #pragma GCC dependency "direct2.c"
38 int i
= X
; /* { dg-error "undeclared|for each" "no macro X" } */
39 int j
= Y
; /* { dg-error "undeclared|for each" "no macro Y" } */
42 #define slashstar /##*
43 #define starslash *##/
45 slashstar starslash
/* { dg-error "parse error|syntax error|expected" "not a comment" } */
46 /* { dg-warning "does not give" "paste warning(s)" { target *-*-* } 45 } */