Revert 316150 which reinstated r316025.
[llvm-project.git] / libunwind / test / alignment.pass.cpp
blob1a3ca5a9230494756f8f9406a7e45fd453594495
1 // -*- C++ -*-
2 //===----------------------------------------------------------------------===//
3 //
4 // The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
11 // The Itanium ABI requires that _Unwind_Exception objects are "double-word
12 // aligned".
14 #include <unwind.h>
16 // EHABI : 8-byte aligned
17 // itanium: largest supported alignment for the system
18 #if defined(_LIBUNWIND_ARM_EHABI)
19 static_assert(alignof(_Unwind_Control_Block) == 8,
20 "_Unwind_Control_Block must be double-word aligned");
21 #else
22 struct MaxAligned {} __attribute__((__aligned__));
23 static_assert(alignof(_Unwind_Exception) == alignof(MaxAligned),
24 "_Unwind_Exception must be maximally aligned");
25 #endif
27 int main()