OSDN Git Service

2010-04-09 Kai Tietz <kai.tietz@onevision.com>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / torture / stackalign / eh-thiscall-1.C
1 /* { dg-do run { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
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 class Base {};
14
15 struct A : virtual public Base
16 {
17   A() {}
18 };
19
20 struct B {};
21
22 __attribute__ ((thiscall))
23 void
24 foo (int j, int k, int m, int n, int o) throw (B,A)
25 {
26   aligned i;
27
28   if (check_int (&i,  __alignof__(i)) != i)
29     abort ();
30
31   if (i != 20 || j != 1 || k != 2 || m != 3 || n != 4 || o != 5)
32     abort ();
33
34   throw A();
35 }
36
37 int
38 main()
39 {
40   try { foo (1, 2, 3, 4, 5); }
41   catch (A& a) { }
42   return 0;
43 }