Merge reload-branch up to revision 101000
[official-gcc.git] / gcc / testsuite / gcc.dg / pr9771-1.c
blob30e42de60b1e4f5bbceaa6da46a53f2e59f06ed2
1 /* 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" } */
6 extern void abort(void);
7 extern void exit(int);
9 register long *B asm ("ebp");
11 long x = 10;
12 long y = 20;
14 void bar(void)
16 B = &y;
19 void foo()
21 long *adr = B;
22 long save = *adr;
24 *adr = 123;
26 bar();
28 *adr = save;
31 int main()
33 B = &x;
35 foo();
37 if (x != 10 || y != 20)
38 abort();
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);