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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [torture/] [stackalign/] [eh-inline-2.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 aligned __attribute__((aligned(ALIGNMENT)));
11
 
12
int global;
13
 
14
void
15
bar (char *p, int size)
16
{
17
  __builtin_strncpy (p, "good", size);
18
}
19
 
20
class Base {};
21
 
22
struct A : virtual public Base
23
{
24
  A() {}
25
};
26
 
27
struct B {};
28
 
29
static void
30
inline __attribute__((always_inline))
31
foo (int size) throw (B,A)
32
{
33
  char *p = (char *) __builtin_alloca (size + 1);
34
  aligned i;
35
 
36
  bar (p, size);
37
  if (__builtin_strncmp (p, "good", size) != 0)
38
    {
39
#ifdef DEBUG
40
      p[size] = '\0';
41
      printf ("Failed: %s != good\n", p);
42
#endif
43
      abort ();
44
    }
45
 
46
  if (check_int (&i,  __alignof__(i)) != i)
47
    abort ();
48
 
49
  throw A();
50
}
51
 
52
int
53
main()
54
{
55
  try { foo (5); }
56
  catch (A& a) { }
57
  return 0;
58
}

powered by: WebSVN 2.1.0

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