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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [bconstp-2.c] - Diff between revs 298 and 338

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

Rev 298 Rev 338
/* As bconstp-1.c, but with the __builtin_constant_p calls
/* As bconstp-1.c, but with the __builtin_constant_p calls
   parenthesized.  */
   parenthesized.  */
/* { dg-do compile } */
/* { dg-do compile } */
 
 
/* This test checks that builtin_constant_p can be used safely in
/* This test checks that builtin_constant_p can be used safely in
   initializers for static data.  The macro X() defined below should
   initializers for static data.  The macro X() defined below should
   be an acceptable initializer expression no matter how complex its
   be an acceptable initializer expression no matter how complex its
   argument is.  */
   argument is.  */
 
 
extern int a;
extern int a;
extern int b;
extern int b;
 
 
extern int foo(void);
extern int foo(void);
extern int bar(void);
extern int bar(void);
 
 
#define X(exp) ((__builtin_constant_p(exp)) ? (exp) : -1)
#define X(exp) ((__builtin_constant_p(exp)) ? (exp) : -1)
 
 
const short tests[] = {
const short tests[] = {
  X(0),
  X(0),
  X(a),
  X(a),
  X(0 && a),
  X(0 && a),
  X(a && b),
  X(a && b),
  X(foo()),
  X(foo()),
  X(0 && foo()),
  X(0 && foo()),
  X(a && foo()),
  X(a && foo()),
  X(foo() && bar())
  X(foo() && bar())
};
};
 
 

powered by: WebSVN 2.1.0

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