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/] [pr9771-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR rtl-optimization/9771 */
2
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
3
/* { dg-require-effective-target ilp32 } */
4
/* { dg-options "-O2 -fomit-frame-pointer -ffixed-ebp" } */
5
 
6
extern void abort(void);
7
extern void exit(int);
8
 
9
register long *B asm ("ebp");
10
 
11
long x = 10;
12
long y = 20;
13
 
14
void bar(void)
15
{
16
  B = &y;
17
}
18
 
19
void foo()
20
{
21
  long *adr = B;
22
  long save = *adr;
23
 
24
  *adr = 123;
25
 
26
  bar();
27
 
28
  *adr = save;
29
}
30
 
31
int main()
32
{
33
  B = &x;
34
 
35
  foo();
36
 
37
  if (x != 10 || y != 20)
38
    abort();
39
 
40
  /* We can't return, as our caller may assume %ebp is preserved!  */
41
  /* We could save/restore it (like foo), but its easier to exit.  */
42
  exit(0);
43
}
44
 

powered by: WebSVN 2.1.0

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