• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s
2 // expected-no-diagnostics
3 
4 // PR3433
5 double g1;
6 short chk1[__alignof__(g1) == 8 ? 1 : -1];
7 short chk2[__alignof__(double) == 8 ? 1 : -1];
8 
9 long long g2;
10 short chk1[__alignof__(g2) == 8 ? 1 : -1];
11 short chk2[__alignof__(long long) == 8 ? 1 : -1];
12 
13 unsigned long long g5;
14 short chk1[__alignof__(g5) == 8 ? 1 : -1];
15 short chk2[__alignof__(unsigned long long) == 8 ? 1 : -1];
16 
17 _Complex double g3;
18 short chk1[__alignof__(g3) == 8 ? 1 : -1];
19 short chk2[__alignof__(_Complex double) == 8 ? 1 : -1];
20 
21 // PR6362
22 struct __attribute__((packed)) {unsigned int a;} g4;
23 short chk1[__alignof__(g4) == 1 ? 1 : -1];
24 short chk2[__alignof__(g4.a) == 1 ? 1 : -1];
25 
26 double g6[3];
27 short chk1[__alignof__(g6) == 8 ? 1 : -1];
28 short chk2[__alignof__(double[3]) == 8 ? 1 : -1];
29 
30 enum { x = 18446744073709551615ULL } g7;
31 short chk1[__alignof__(g7) == 8 ? 1 : -1];
32 
33 // PR5637
34 
35 #define ALIGNED(x) __attribute__((aligned(x)))
36 
37 typedef ALIGNED(2) struct {
38   char a[3];
39 } T;
40 
41 short chk1[sizeof(T)       == 3 ? 1 : -1];
42 short chk2[sizeof(T[1])    == 4 ? 1 : -1];
43 short chk3[sizeof(T[2])    == 6 ? 1 : -1];
44 short chk4[sizeof(T[2][1]) == 8 ? 1 : -1];
45 short chk5[sizeof(T[1][2]) == 6 ? 1 : -1];
46 
47 typedef struct ALIGNED(2) {
48   char a[3];
49 } T2;
50 
51 short chk1[sizeof(T2)       == 4 ? 1 : -1];
52 short chk2[sizeof(T2[1])    == 4 ? 1 : -1];
53 short chk3[sizeof(T2[2])    == 8 ? 1 : -1];
54 short chk4[sizeof(T2[2][1]) == 8 ? 1 : -1];
55 short chk5[sizeof(T2[1][2]) == 8 ? 1 : -1];
56