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/] [c99-const-expr-10.c] - Blame information for rev 298

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

Line No. Rev Author Line
1 298 jeremybenn
/* Test for constant expressions: invalid null pointer constants in
2
   various contexts (make sure NOPs are not inappropriately
3
   stripped).  */
4
/* Origin: Joseph Myers <joseph@codesourcery.com> */
5
/* { dg-do compile } */
6
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
7
 
8
void *p = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
9
struct s { void *a; } q = { (__SIZE_TYPE__)(void *)0 }; /* { dg-error "without a cast" } */
10
void *
11
f (void)
12
{
13
  void *r;
14
  r = (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
15
  return (__SIZE_TYPE__)(void *)0; /* { dg-error "without a cast" } */
16
}
17
void g (void *); /* { dg-message "but argument is of type" } */
18
void
19
h (void)
20
{
21
  g ((__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
22
}
23
void g2 (int, void *); /* { dg-message "but argument is of type" } */
24
void
25
h2 (void)
26
{
27
  g2 (0, (__SIZE_TYPE__)(void *)0); /* { dg-error "without a cast" } */
28
}

powered by: WebSVN 2.1.0

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