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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [stackalign/] [throw-4.C] - Blame information for rev 715

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

Line No. Rev Author Line
1 693 jeremybenn
/* { dg-do run } */
2
/* { dg-skip-if "Stack alignment is too small" { hppa*-*-hpux* } "*" "" } */
3
 
4
#include "check.h"
5
 
6
#ifndef ALIGNMENT
7
#define ALIGNMENT       64
8
#endif
9
 
10
typedef int t_align __attribute__((aligned(ALIGNMENT)));
11
 
12
 
13
int global, global2;
14
void bar()
15
{
16
        volatile t_align a = 1;
17
        int i,j,k;
18
        i=j=k=0;
19
        for (i=0; i < global; i++)
20
          for (j=0; j < i; j++)
21
            {
22
              global2 = k;
23
              throw 0;
24
            }
25
        if (check_int ((int *) &a,  __alignof__(a)) != a)
26
          abort ();
27
}
28
 
29
int main()
30
{
31
        int ll = 1;
32
        int i = 0,j = 1,k = 2,l = 3,m = 4,n = 5;
33
        try {
34
          for (; i < global; i++)
35
          for (; j < i; j++)
36
          for (; k < j; k++)
37
          for (; l < k; l++)
38
          for (; m < l; m++)
39
          for (; n < m; n++)
40
                global2 = k;
41
          bar ();
42
        }
43
        catch (...)
44
        {
45
        }
46
        ll = i+j+k+l+m+n;
47
        if (ll != 15)
48
        {
49
#ifdef DEBUG
50
                printf("FAIL: sum %d != 15\n", ll);
51
#endif
52
                abort();
53
        }
54
        return 0;
55
}

powered by: WebSVN 2.1.0

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