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 "syntax|parse" "non-include" }*/
14 /*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 13 }*/
15 HASHINCLUDE
<somerandomfile
> /*{ dg-error "syntax|parse" "non-include 2" }*/
16 /*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 15 }*/
20 HASH define X
1 /* { dg-error "syntax error" "# from macro" } */
21 HASHDEFINE Y
1 /* { dg-error "syntax error" "#define from macro" } */
24 #pragma GCC dependency "direct2.c"
29 int i
= X
; /* { dg-error "undeclared|for each" "no macro X" } */
30 int j
= Y
; /* { dg-error "undeclared|for each" "no macro Y" } */
33 #define slashstar /##*
34 #define starslash *##/
36 slashstar starslash
/* { dg-error "(parse|syntax) error" "not a comment" } */
37 /* { dg-warning "does not give" "paste warning(s)" { target *-*-* } 36 } */