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/] [g++.dg/] [torture/] [stackalign/] [eh-alloca-1.C] - Blame information for rev 307

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

Line No. Rev Author Line
1 301 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
class Base {};
20
 
21
struct A : virtual public Base
22
{
23
  A() {}
24
};
25
 
26
struct B {};
27
 
28
void
29
foo (int size) throw (B,A)
30
{
31
  char *p = (char*) __builtin_alloca (size + 1);
32
  aligned i;
33
 
34
  bar (p, size);
35
  if (__builtin_strncmp (p, "good", size) != 0)
36
    {
37
#ifdef DEBUG
38
      p[size] = '\0';
39
      printf ("Failed: %s != good\n", p);
40
#endif
41
      abort ();
42
    }
43
 
44
  if (check_int (&i,  __alignof__(i)) != i)
45
    abort ();
46
 
47
  throw A();
48
}
49
 
50
int
51
main()
52
{
53
  try { foo (5); }
54
  catch (A& a) { }
55
  return 0;
56
}

powered by: WebSVN 2.1.0

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