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