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.dg/] [torture/] [stackalign/] [alloca-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
 
3
#include "check.h"
4
 
5
#ifndef ALIGNMENT
6
#define ALIGNMENT       64
7
#endif
8
 
9
typedef int aligned __attribute__((aligned(ALIGNMENT)));
10
 
11
int global;
12
 
13
void
14
bar (char *p, int size)
15
{
16
  __builtin_strncpy (p, "good", size);
17
}
18
 
19
void
20
foo (int size)
21
{
22
  char *p = __builtin_alloca (size + 1);
23
  aligned i;
24
 
25
  bar (p, size);
26
  if (__builtin_strncmp (p, "good", size) != 0)
27
    {
28
#ifdef DEBUG
29
      p[size] = '\0';
30
      printf ("Failed: %s != good\n", p);
31
#endif
32
      abort ();
33
    }
34
 
35
  if (check_int (&i,  __alignof__(i)) != i)
36
    abort ();
37
}
38
 
39
int
40
main()
41
{
42
  foo (5);
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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