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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [cond-constqual-1.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test for const qualification of type of conditional expression.  */
2
/* { dg-do compile } */
3
/* { dg-options "" } */
4
 
5
int foo (int) __attribute__ ((const));
6
const int i;
7
 
8
void
9
test (void)
10
{
11
  __typeof__ (1 ? foo (0) : 0) texpr;
12
  __typeof__ (1 ? i : 0) texpr2;
13
  texpr = 0;  /* { dg-bogus "read-only variable" "conditional expression with call to const function" } */
14
  texpr2 = 0; /* { dg-error "read-only variable" "conditional expression with const variable" } */
15
}

powered by: WebSVN 2.1.0

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