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
5 expansion. Same as direct2.c, with -save-temps applied; results
6 should be identical. */
8 /* { dg-do compile } */
9 /* { dg-options "-save-temps -ansi -pedantic-errors" } */
12 #define HASHDEFINE #define
13 #define HASHINCLUDE #include
15 HASH include
"somerandomfile" /*{ dg-error "stray" "non-include" }*/
16 /*{ dg-bogus "No such" "don't execute non-include" { target *-*-* } 15 }*/
17 int resync_parser_1
; /*{ dg-error "parse|syntax|expected" "" { target *-*-* } 15 }*/
19 HASHINCLUDE
<somerandomfile
> /*{ dg-error "stray|expected" "non-include 2" }*/
20 /*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 18 }*/
25 HASH define X
1 /* { dg-error "stray|undeclared|parse|syntax|expected|for each" "# from macro" } */
31 HASHDEFINE Y
1 /* { dg-error "stray|undeclared|parse|syntax|expected|for each" "#define from macro" } */
35 #pragma GCC dependency "direct2.c"
40 int i
= X
; /* { dg-error "undeclared|for each" "no macro X" } */
41 int j
= Y
; /* { dg-error "undeclared|for each" "no macro Y" } */
44 /* { dg-final { cleanup-saved-temps } } */