Home | History | Annotate | Download | only in support.types
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 #include <cstddef>
     11 #include <type_traits>
     12 
     13 // max_align_t is a POD type whose alignment requirement is at least as
     14 //   great as that of every scalar type
     15 
     16 #include <stdio.h>
     17 
     18 int main()
     19 {
     20     static_assert(std::is_pod<std::max_align_t>::value,
     21                   "std::is_pod<std::max_align_t>::value");
     22     static_assert((std::alignment_of<std::max_align_t>::value >=
     23                   std::alignment_of<long long>::value),
     24                   "std::alignment_of<std::max_align_t>::value >= "
     25                   "std::alignment_of<long long>::value");
     26     static_assert(std::alignment_of<std::max_align_t>::value >=
     27                   std::alignment_of<long double>::value,
     28                   "std::alignment_of<std::max_align_t>::value >= "
     29                   "std::alignment_of<long double>::value");
     30     static_assert(std::alignment_of<std::max_align_t>::value >=
     31                   std::alignment_of<void*>::value,
     32                   "std::alignment_of<std::max_align_t>::value >= "
     33                   "std::alignment_of<void*>::value");
     34 }
     35