diff options
Diffstat (limited to 'test/SemaCXX/pragma-pack.cpp')
-rw-r--r-- | test/SemaCXX/pragma-pack.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/pragma-pack.cpp b/test/SemaCXX/pragma-pack.cpp index 1bc738b087a9..5c1d5c6c82af 100644 --- a/test/SemaCXX/pragma-pack.cpp +++ b/test/SemaCXX/pragma-pack.cpp @@ -32,3 +32,26 @@ struct Sub : virtual Base { int check[sizeof(Sub) == 13 ? 1 : -1]; } + +namespace llvm_support_endian { + +template<typename, bool> struct X; + +#pragma pack(push) +#pragma pack(1) +template<typename T> struct X<T, true> { + T t; +}; +#pragma pack(pop) + +#pragma pack(push) +#pragma pack(2) +template<> struct X<long double, true> { + long double c; +}; +#pragma pack(pop) + +int check1[__alignof(X<int, true>) == 1 ? 1 : -1]; +int check2[__alignof(X<long double, true>) == 2 ? 1 : -1]; + +} |