[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Sema / attr-aligned.c
blob130840d46650d83243dd0346b04a2b218c8aaa7a
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin9 -fsyntax-only -verify %s
3 int x __attribute__((aligned(3))); // expected-error {{requested alignment is not a power of 2}}
4 int y __attribute__((aligned(1ull << 33))); // expected-error {{requested alignment must be 4294967296 bytes or smaller}}
5 int y __attribute__((aligned(1ull << 32)));
6 // GH50534
7 int z __attribute__((aligned((__int128_t)0x1234567890abcde0ULL << 64))); // expected-error {{requested alignment must be 4294967296 bytes or smaller}}
9 // PR26444
10 int y __attribute__((aligned(1 << 29)));
11 int y __attribute__((aligned(1 << 28)));
13 // PR3254
14 short g0[3] __attribute__((aligned));
15 short g0_chk[__alignof__(g0) == 16 ? 1 : -1];
17 typedef char ueber_aligned_char __attribute__((aligned(8)));
19 struct struct_with_ueber_char {
20 ueber_aligned_char c;
23 char a = 0;
25 char a0[__alignof__(ueber_aligned_char) == 8? 1 : -1] = { 0 };
26 char a1[__alignof__(struct struct_with_ueber_char) == 8? 1 : -1] = { 0 };
27 char a2[__alignof__(a) == 1? : -1] = { 0 };
28 char a3[sizeof(a) == 1? : -1] = { 0 };
30 typedef long long __attribute__((aligned(1))) underaligned_longlong;
31 char a4[__alignof__(underaligned_longlong) == 1 ?: -1] = {0};
33 typedef long long __attribute__((aligned(1))) underaligned_complex_longlong;
34 char a5[__alignof__(underaligned_complex_longlong) == 1 ?: -1] = {0};
36 int b __attribute__((aligned(2)));
37 char b1[__alignof__(b) == 2 ?: -1] = {0};
39 struct C { int member __attribute__((aligned(2))); } c;
40 char c1[__alignof__(c) == 4 ?: -1] = {0};
41 char c2[__alignof__(c.member) == 4 ?: -1] = {0};
43 struct D { int member __attribute__((aligned(2))) __attribute__((packed)); } d;
44 char d1[__alignof__(d) == 2 ?: -1] = {0};
45 char d2[__alignof__(d.member) == 2 ?: -1] = {0};
47 struct E { int member __attribute__((aligned(2))); } __attribute__((packed));
48 struct E e;
49 char e1[__alignof__(e) == 2 ?: -1] = {0};
50 char e2[__alignof__(e.member) == 2 ?: -1] = {0};
52 typedef struct { char c[16]; } S;
53 typedef S overaligned_struct __attribute__((aligned(16)));
54 typedef overaligned_struct array_with_overaligned_struct[11];
55 typedef char array_with_align_attr[11] __attribute__((aligned(16)));
57 char f0[__alignof__(array_with_overaligned_struct) == 16 ? 1 : -1] = { 0 };
58 char f1[__alignof__(array_with_align_attr) == 16 ? 1 : -1] = { 0 };
59 array_with_overaligned_struct F2;
60 char f2[__alignof__(F2) == 16 ? 1 : -1] = { 0 };
61 array_with_align_attr F3;
62 char f3[__alignof__(F3) == 16 ? 1 : -1] = { 0 };