| 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 |
static void |
| 24 |
inline __attribute__((always_inline)) |
| 25 |
foo (void) |
| 26 |
#if __cplusplus <= 201402L |
| 27 |
throw (B,A) // { dg-warning "deprecated" "" { target { c++11 && { ! c++17 } } } } |
| 28 |
#endif |
| 29 |
{ |
| 30 |
aligned i; |
| 31 |
|
| 32 |
if (check_int (&i, __alignof__(i)) != i) |
| 33 |
abort (); |
| 34 |
throw A(); |
| 35 |
} |
| 36 |
|
| 37 |
int |
| 38 |
main() |
| 39 |
{ |
| 40 |
try { foo (); } |
| 41 |
catch (A& a) { } |
| 42 |
return 0; |
| 43 |
} |