1 // RUN: %clang_cc1 -fsyntax-only -DTEST_FOR_WARNING -Wno-error=incompatible-ms-struct -verify -triple i686-apple-darwin9 -std=c++11 %s
2 // RUN: %clang_cc1 -fsyntax-only -DTEST_FOR_WARNING -Wno-error=incompatible-ms-struct -verify -triple armv7-apple-darwin9 -std=c++11 %s
3 // RUN: %clang_cc1 -fsyntax-only -DTEST_FOR_ERROR -verify -triple armv7-apple-darwin9 -std=c++11 %s
4 // RUN: %clang_cc1 -fsyntax-only -DNO_PRAGMA -mms-bitfields -verify -triple armv7-apple-darwin9 -std=c++11 %s
17 // expected-error@-2 {{ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions}}
18 #elif defined(TEST_FOR_WARNING)
19 // expected-warning@-4 {{ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions}}
26 static_assert(__builtin_offsetof(B
, d
) == 12,
27 "We can't allocate the bitfield into the padding under ms_struct");
32 // expected-error@-2 {{ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions}}
33 #elif defined(TEST_FOR_WARNING)
34 // expected-warning@-4 {{ms_struct may not produce Microsoft-compatible layouts for classes with base classes or virtual functions}}
40 static_assert(__builtin_offsetof(C
, n
) == 8,
41 "long long field in ms_struct should be 8-byte aligned");
42 #if !defined(TEST_FOR_ERROR) && !defined(TEST_FOR_WARNING)
43 // expected-no-diagnostics