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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [i386/] [20020224-1.c] - Blame information for rev 823

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

Line No. Rev Author Line
1 149 jeremybenn
/* PR target/5755
2
   This testcase failed because the caller of a function returning struct
3
   expected the callee to pop up the hidden return structure pointer,
4
   while callee was actually not poping it up (as the hidden argument
5
   was passed in register).  */
6
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
7
/* { dg-options "-O2 -fomit-frame-pointer" } */
8
 
9
extern void abort (void);
10
extern void exit (int);
11
 
12
typedef struct {
13
   int a1, a2;
14
} A;
15
 
16
A a;
17
 
18
A __attribute__ ((regparm (2)))
19
foo (int x)
20
{
21
  return a;
22
}
23
 
24
int __attribute__ ((regparm (2)))
25
bar (int x)
26
{
27
  int r = foo(0).a2;
28
  return r;
29
}
30
 
31
int
32
main ()
33
{
34
  int f;
35
  a.a1 = 530;
36
  a.a2 = 980;
37
  f = bar (0);
38
  if (f != 980)
39
    abort ();
40
  exit (0);
41
}

powered by: WebSVN 2.1.0

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