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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [20040223-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* GCC was not warning about taking the address of parameters or
2
   fields of struct parameters when returning them.  */
3
/* PR c/14156 */
4
 
5
/* { dg-do compile  } */
6
 
7
 
8
int * f( int a)
9
{
10
        return &a;/* { dg-warning "address" "" } */
11
}
12
 
13
int * g()
14
{
15
        int b = 0;
16
        return &b;/* { dg-warning "address" "" } */
17
}
18
 
19
struct ll
20
{
21
  int i;
22
};
23
 
24
int *h(struct ll c)
25
{
26
  return &c.i;/* { dg-warning "address" "" } */
27
}
28
 
29
 
30
struct ll d;
31
 
32
int *i()
33
{
34
  return &d.i;/* { dg-bogus "address" "" } */
35
}
36
 
37
 
38
int *j(struct ll *c)
39
{
40
  return &c->i; /* { dg-bogus "address" "" } */
41
}

powered by: WebSVN 2.1.0

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