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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [powerpc/] [ppc-stackalign-1.c] - Blame information for rev 859

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

Line No. Rev Author Line
1 322 jeremybenn
/* { dg-do run { target powerpc*-*-linux* powerpc*-*-eabi* } } */
2
/* { dg-options {} } */
3
 
4
/* Test stack pointer alignment against variable alloca.  */
5
/* Inspired by PR libgcj/10610.  */
6
/* Origin: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>.  */
7
 
8
extern void abort (void);
9
extern void exit (int);
10
 
11
register unsigned long sp __asm__ ("r1");
12
 
13
void g (int * val __attribute__ ((unused)))
14
{
15
  if (sp & 0xf)
16
    abort ();
17
}
18
 
19
void f (int val)
20
{
21
  int *val1 = __builtin_alloca (val);
22
 
23
  g (val1);
24
  return;
25
}
26
 
27
int main (void)
28
{
29
  int i;
30
 
31
  for (i = 1; i < 32; i++)
32
    f (i);
33
 
34
  exit (0);
35
}

powered by: WebSVN 2.1.0

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