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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [cpp/] [_Pragma1.c] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
/* Copyright (C) 2000 Free Software Foundation, Inc.  */
/* Copyright (C) 2000 Free Software Foundation, Inc.  */
 
 
/* { dg-do preprocess } */
/* { dg-do preprocess } */
 
 
/* Tests the _Pragma operator.  Contributed by Neil Booth 1 Nov 2000.  */
/* Tests the _Pragma operator.  Contributed by Neil Booth 1 Nov 2000.  */
 
 
/* Within the preprocessor, the easy pragma to test is "poison".  */
/* Within the preprocessor, the easy pragma to test is "poison".  */
 
 
#pragma GCC poison p1
#pragma GCC poison p1
p1                              /* { dg-error "poisoned" } */
p1                              /* { dg-error "poisoned" } */
 
 
/* Standard use of _Pragma.  */
/* Standard use of _Pragma.  */
_Pragma ("GCC poison p2")
_Pragma ("GCC poison p2")
p2                              /* { dg-error "poisoned" } */
p2                              /* { dg-error "poisoned" } */
 
 
/* Don't interpret _Pragmas in directives.  The standard is not clear
/* Don't interpret _Pragmas in directives.  The standard is not clear
   on this, but I think this makes most sense.  */
   on this, but I think this makes most sense.  */
#if 1 _Pragma (L"GCC poison p3") /* { dg-error "missing binary operator" } */
#if 1 _Pragma (L"GCC poison p3") /* { dg-error "missing binary operator" } */
p3
p3
#endif
#endif
 
 
#define M1 _Pragma ("GCC poison p4")
#define M1 _Pragma ("GCC poison p4")
p4                              /* No problem; not yet poisoned.  */
p4                              /* No problem; not yet poisoned.  */
#define M2(x) _Pragma (#x)
#define M2(x) _Pragma (#x)
 
 
/* Now test macro expansion with embedded _Pragmas.  */
/* Now test macro expansion with embedded _Pragmas.  */
M1 p4                           /* { dg-error "poisoned" } */
M1 p4                           /* { dg-error "poisoned" } */
M2 (GCC poison p5) p5           /* { dg-error "poisoned" } */
M2 (GCC poison p5) p5           /* { dg-error "poisoned" } */
 
 
/* Not interpreting _Pragma in directives means they don't nest.  */
/* Not interpreting _Pragma in directives means they don't nest.  */
_Pragma ("_Pragma (\"GCC poison p6\") GCC poison p7")
_Pragma ("_Pragma (\"GCC poison p6\") GCC poison p7")
p6
p6
p7
p7
 
 
/* Check we ignore them in false conditionals.  */
/* Check we ignore them in false conditionals.  */
#if 0
#if 0
_Pragma ("GCC poison p8")
_Pragma ("GCC poison p8")
#endif
#endif
p8                              /* No problem.  */
p8                              /* No problem.  */
 
 

powered by: WebSVN 2.1.0

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