|
1 | 1 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++98 -Wno-inaccessible-base
|
2 | 2 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base
|
3 |
| -// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=13 |
4 |
| -// RUN: %clang_cc1 -triple x86_64-scei-ps4 %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -DCLANG_ABI_COMPAT=6 |
5 | 3 | // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=6 -DCLANG_ABI_COMPAT=6
|
6 |
| -// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify -std=c++11 -Wno-inaccessible-base -fclang-abi-compat=13 -DCLANG_ABI_COMPAT=13 |
7 | 4 | // expected-no-diagnostics
|
8 | 5 |
|
9 | 6 | #define SA(n, p) int a##n[(p) ? 1 : -1]
|
@@ -607,37 +604,3 @@ namespace PR37275 {
|
607 | 604 | #endif
|
608 | 605 | #pragma pack(pop)
|
609 | 606 | }
|
610 |
| - |
611 |
| -namespace non_pod { |
612 |
| -struct t1 { |
613 |
| -protected: |
614 |
| - int a; |
615 |
| -}; |
616 |
| -// GCC prints warning: ignoring packed attribute because of unpacked non-POD field 't1 t2::v1'` |
617 |
| -struct t2 { |
618 |
| - char c1; |
619 |
| - short s1; |
620 |
| - char c2; |
621 |
| - t1 v1; |
622 |
| -} __attribute__((packed)); |
623 |
| -#if defined(CLANG_ABI_COMPAT) && CLANG_ABI_COMPAT <= 13 |
624 |
| -_Static_assert(_Alignof(t1) == 4, ""); |
625 |
| -_Static_assert(_Alignof(t2) == 1, ""); |
626 |
| -#else |
627 |
| -_Static_assert(_Alignof(t1) == 4, ""); |
628 |
| -_Static_assert(_Alignof(t2) == 4, ""); |
629 |
| -#endif |
630 |
| -_Static_assert(sizeof(t2) == 8, ""); // it's still packing the rest of the struct |
631 |
| -} // namespace non_pod |
632 |
| - |
633 |
| -namespace non_pod_packed { |
634 |
| -struct t1 { |
635 |
| -protected: |
636 |
| - int a; |
637 |
| -} __attribute__((packed)); |
638 |
| -struct t2 { |
639 |
| - t1 v1; |
640 |
| -} __attribute__((packed)); |
641 |
| -_Static_assert(_Alignof(t1) == 1, ""); |
642 |
| -_Static_assert(_Alignof(t2) == 1, ""); |
643 |
| -} // namespace non_pod_packed |
0 commit comments