OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [direct2.c] - Blame information for rev 307

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Copyright (C) 2001 Free Software Foundation, Inc.
2
   Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com> */
3
 
4
/* Test of prohibition on directives which result from macro expansion.
5
   See also direct2s.c */
6
 
7
/* { dg-do compile } */
8
 
9
#define HASH #
10
#define HASHDEFINE #define
11
#define HASHINCLUDE #include
12
 
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 }*/
16
 
17
HASHINCLUDE <somerandomfile> /*{ dg-error "stray|expected" "non-include 2" }*/
18
/*{ dg-bogus "No such" "don't execute non-include 2" { target *-*-* } 17 }*/
19
int resync_parser_2;
20
 
21
void g1 ()
22
{
23
HASH define X 1 /* { dg-error "stray|undeclared|parse|syntax|expected|for each" "# from macro" } */
24
  int resync_parser_3;
25
}
26
 
27
void g2 ()
28
{
29
HASHDEFINE  Y 1 /* { dg-error "stray|undeclared|parse|syntax|expected|for each" "#define from macro" } */
30
  int resync_parser_4;
31
}
32
 
33
#pragma GCC dependency "direct2.c"
34
#
35
 
36
void f ()
37
{
38
  int i = X;    /* { dg-error "undeclared|for each" "no macro X" } */
39
  int j = Y;    /* { dg-error "undeclared|for each" "no macro Y" } */
40
}
41
 
42
#define slashstar /##*
43
#define starslash *##/
44
 
45
slashstar starslash /* { dg-error "parse error|syntax error|expected" "not a comment" } */
46
/* { dg-error "does not give" "paste warning(s)" { target *-*-* } 45 } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.