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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [bconstp-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
 
3
/* This test checks that builtin_constant_p can be used safely in
4
   initializers for static data.  The macro X() defined below should
5
   be an acceptable initializer expression no matter how complex its
6
   argument is.  */
7
 
8
extern int a;
9
extern int b;
10
 
11
extern int foo(void);
12
extern int bar(void);
13
 
14
#define X(exp) (__builtin_constant_p(exp) ? (exp) : -1)
15
 
16
const short tests[] = {
17
  X(0),
18
  X(a),
19
  X(0 && a),
20
  X(a && b),
21
  X(foo()),
22
  X(0 && foo()),
23
  X(a && foo()),
24
  X(foo() && bar())
25
};

powered by: WebSVN 2.1.0

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