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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* Test that the ms_hook_prologue attribute generates the correct code.  */
2
 
3
/* { dg-do run } */
4
/* { dg-require-effective-target ms_hook_prologue } */
5
/* { dg-options "-O2 -fomit-frame-pointer" } */
6
 
7
int __attribute__ ((__ms_hook_prologue__)) foo ()
8
{
9
  unsigned char *ptr = (unsigned char *) foo;
10
 
11
  /* The NOP mov must not be optimized away by optimizations.
12
     The push %ebp, mov %esp, %ebp must not be removed by
13
     -fomit-frame-pointer */
14
 
15
  /* movl.s %edi, %edi */
16
  if(*ptr++ != 0x8b) return 1;
17
  if(*ptr++ != 0xff) return 1;
18
  /* push %ebp */
19
  if(*ptr++ != 0x55) return 1;
20
  /* movl.s %esp, %ebp */
21
  if(*ptr++ != 0x8b) return 1;
22
  if(*ptr++ != 0xec) return 1;
23
  return 0;
24
}
25
 
26
int main ()
27
{
28
  return foo();
29
}

powered by: WebSVN 2.1.0

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