diff options
Diffstat (limited to 'test/Sema/struct-packed-align.c')
-rw-r--r-- | test/Sema/struct-packed-align.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/Sema/struct-packed-align.c b/test/Sema/struct-packed-align.c index abdcd8e6b9eb..aeba8d6fd938 100644 --- a/test/Sema/struct-packed-align.c +++ b/test/Sema/struct-packed-align.c @@ -1,5 +1,6 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify // RUN: %clang_cc1 %s -fsyntax-only -triple=x86_64-windows-coff -verify +// RUN: %clang_cc1 %s -fsyntax-only -triple=x86_64-scei-ps4 -verify // Packed structs. struct s { @@ -146,13 +147,24 @@ extern int n2[__alignof(struct nS) == 1 ? 1 : -1]; // See the documentation of -Wpacked-bitfield-compat for more information. struct packed_chars { char a:4; +#ifdef __ORBIS__ + // Test for pre-r254596 clang behavior on the PS4 target. PS4 must maintain + // ABI backwards compatibility. + char b:8 __attribute__ ((packed)); + // expected-warning@-1 {{'packed' attribute ignored for field of type 'char'}} + char c:4; +#else char b:8 __attribute__ ((packed)); // expected-warning@-1 {{'packed' attribute was ignored on bit-fields with single-byte alignment in older versions of GCC and Clang}} char c:4; +#endif }; -#if defined(_WIN32) && !defined(__declspec) // _MSC_VER is unavailable in cc1. +#if (defined(_WIN32) || defined(__ORBIS__)) && !defined(__declspec) // _MSC_VER is unavailable in cc1. // On Windows clang uses MSVC compatible layout in this case. +// +// Additionally, test for pre-r254596 clang behavior on the PS4 target. PS4 +// must maintain ABI backwards compatibility. extern int o1[sizeof(struct packed_chars) == 3 ? 1 : -1]; extern int o2[__alignof(struct packed_chars) == 1 ? 1 : -1]; #else |