OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr40718.c] - Blame information for rev 378

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

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do run } */
2
/* { dg-require-effective-target ilp32 } */
3
/* { dg-options "-O1 -foptimize-sibling-calls" } */
4
 
5
void abort (void);
6
 
7
struct S
8
{
9
  void (__attribute__((__stdcall__)) *f) (struct S *);
10
  int i;
11
};
12
 
13
void __attribute__((__stdcall__))
14
foo (struct S *s)
15
{
16
  s->i++;
17
}
18
 
19
void __attribute__((__stdcall__))
20
bar (struct S *s)
21
{
22
  foo(s);
23
  s->f(s);
24
}
25
 
26
int main (void)
27
{
28
  struct S s = { foo, 0 };
29
 
30
  bar (&s);
31
  if (s.i != 2)
32
    abort ();
33
 
34
  return 0;
35
}
36
 

powered by: WebSVN 2.1.0

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