mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 13:36:08 +00:00

alignments In the following code, the first element is aligned on a 16-byte boundary, but the remaining elements aren't: ``` typedef char int8_a16 __attribute__((aligned(16))); int8_a16 array[4]; ``` Currently clang doesn't reject the code, but it should since it can cause crashes at runtime. This patch also fixes assertion failures in CodeGen caused by the changes in https://reviews.llvm.org/D123649. Differential Revision: https://reviews.llvm.org/D133711
16 lines
519 B
C
16 lines
519 B
C
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
|
|
|
|
// PR5637
|
|
|
|
typedef __attribute__((aligned(16))) struct {
|
|
unsigned long long w[3];
|
|
} UINT192;
|
|
|
|
UINT192 ten2mk192M[] = { // expected-error {{size of array element}}
|
|
{{0xcddd6e04c0592104ULL, 0x0fcf80dc33721d53ULL, 0xa7c5ac471b478423ULL}},
|
|
{{0xcddd6e04c0592104ULL, 0x0fcf80dc33721d53ULL, 0xa7c5ac471b478423ULL}},
|
|
{{0xcddd6e04c0592104ULL, 0x0fcf80dc33721d53ULL, 0xa7c5ac471b478423ULL}}
|
|
};
|
|
|
|
short chk1[sizeof(ten2mk192M) == 80 ? 1 : -1];
|