Eric Fiselier | 9ac4c9c | 2016-07-20 23:56:42 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
| 2 | //===----------------------------------------------------------------------===// |
| 3 | // |
Chandler Carruth | 61860a5 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 5 | // See https://llvm.org/LICENSE.txt for license information. |
| 6 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Eric Fiselier | 9ac4c9c | 2016-07-20 23:56:42 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // The Itanium ABI requires that _Unwind_Exception objects are "double-word |
| 11 | // aligned". |
| 12 | |
| 13 | #include <unwind.h> |
| 14 | |
Saleem Abdulrasool | 93166ad | 2017-08-23 16:50:27 +0000 | [diff] [blame] | 15 | // EHABI : 8-byte aligned |
| 16 | // itanium: largest supported alignment for the system |
| 17 | #if defined(_LIBUNWIND_ARM_EHABI) |
| 18 | static_assert(alignof(_Unwind_Control_Block) == 8, |
| 19 | "_Unwind_Control_Block must be double-word aligned"); |
| 20 | #else |
| 21 | struct MaxAligned {} __attribute__((__aligned__)); |
| 22 | static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned), |
| 23 | "_Unwind_Exception must be maximally aligned"); |
| 24 | #endif |
Eric Fiselier | 9ac4c9c | 2016-07-20 23:56:42 +0000 | [diff] [blame] | 25 | |
| 26 | int main() |
| 27 | { |
| 28 | } |