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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [decl-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
/* Copyright (C) 2002 Free Software Foundation, Inc.
2
 
3
   Source: Neil Booth, 12 Feb 2002.
4
 
5
   In the declaration of proc, x must be parsed as a typedef name (C99
6
   6.7.5.3 p11.  Also see C89 DR #009, which was erroneously ommitted
7
   from C99, and resubmitted as DR #249: if in a parameter
8
   declaration, an identifier can be read as a typedef name or a
9
   paramter name, it is read as a typedef name).  */
10
 
11
/* { dg-do compile } */
12
 
13
typedef int x;
14
typedef int y;
15
int proc(int (x));      /* x is a typedef, param to proc is a function.  */
16
int proc2(int x);       /* x is an identifier, param is an int.  */
17
 
18
/* Parameter to proc3 is unnamed, with type a function that returns
19
   int and takes a single argument of type function with one int
20
   parameter returning int.  In particular, proc3 is not a function
21
   that takes a parameter y that is a function with one int parameter
22
   returning int.  8-)  */
23
int proc3(int (y (x)));
24
 
25
int main ()
26
{
27
  proc (proc2);         /* { dg-bogus "integer from pointer" } */
28
  return proc3 (proc);  /* { dg-bogus "incompatible pointer type" } */
29
}

powered by: WebSVN 2.1.0

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