OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [bconstp-3.c] - Blame information for rev 298

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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