Debian Codegraph @

gcc/testsuite/g++.dg/torture/stackalign/eh-global-1.C

raw
1 /* { 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 class Base {};
15
16 struct A : virtual public Base
17 {
18 A() {}
19 };
20
21 struct B {};
22
23 void
24 foo (void)
25 #if __cplusplus <= 201402L
26 throw (B,A) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } }
27 #endif
28 {
29 aligned i;
30
31 if (check_int (&i, __alignof__(i)) != i)
32 abort ();
33
34 throw A();
35 }
36
37 int
38 main()
39 {
40 try { foo (); }
41 catch (A& a) { }
42 return 0;
43 }