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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [comp-return-1.c] - Blame information for rev 749

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

Line No. Rev Author Line
1 689 jeremybenn
/* When merging a nonprototype definition of a function with a prior
2
   prototype declaration, the composite type of the return types must
3
   be formed rather than just copying the function type.  */
4
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5
/* { dg-do compile } */
6
 
7
typedef int a[];
8
typedef int a5[5];
9
typedef int a10[10];
10
 
11
a *f1 ();
12
a5 *f1 () { return 0; }
13
 
14
a *f2 (void);
15
a5 *f2 () { return 0; }
16
 
17
a *f3 ();
18
a5 *f3 (void) { return 0; }
19
 
20
a *f4 (void);
21
a5 *f4 (void) { return 0; }
22
 
23
void
24
g (void)
25
{
26
  a10 *x;
27
  x = f1 (); /* { dg-error "incompatible" "f1" } */
28
  x = f2 (); /* { dg-error "incompatible" "f2" } */
29
  x = f3 (); /* { dg-error "incompatible" "f3" } */
30
  x = f4 (); /* { dg-error "incompatible" "f4" } */
31
}

powered by: WebSVN 2.1.0

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