OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [stackalign/] [nested-3.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
copy (char *p, int size)
15
{
16
  __builtin_strncpy (p, "good", size);
17
}
18
 
19
void
20
foo (int size)
21
{
22
  aligned j;
23
 
24
   __attribute__ ((__noinline__))
25
  void bar (int size)
26
    {
27
      char *p = __builtin_alloca (size + 1);
28
      aligned i;
29
 
30
      copy (p, size);
31
      if (strncmp (p, "good", size) != 0)
32
        {
33
#ifdef DEBUG
34
          p[size] = '\0';
35
          printf ("Failed: %s != good\n", p);
36
#endif
37
          abort ();
38
        }
39
 
40
      if (check_int (&i,  __alignof__(i)) != i)
41
        abort ();
42
 
43
      if (check_int (&j,  __alignof__(j)) != j)
44
        abort ();
45
 
46
      j = -20;
47
    }
48
  bar (size);
49
 
50
  if (j != -20)
51
    abort ();
52
 
53
  if (check_int (&j,  __alignof__(j)) != j)
54
    abort ();
55
}
56
 
57
int
58
main()
59
{
60
  foo (5);
61
  return 0;
62
}

powered by: WebSVN 2.1.0

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