1 // RUN: %clang_cc1 -triple armv7-unknown-unknown -target-abi apcs-gnu %s -verify
2 // RUN: %clang_cc1 -triple armv7-unknown-unknown -target-abi aapcs %s -verify
3 // expected-no-diagnostics
5 #define check(name, cond) int _##name##_check[(cond) ? 1 : -1]
7 struct s0
{ char field0
; double field1
; };
9 check(s0_size
, sizeof(struct s0
) == 16);
11 check(s0_size
, sizeof(struct s0
) == 12);
14 struct s1
{ char field0
; long double field1
; };
16 check(s1_size
, sizeof(struct s1
) == 16);
18 check(s1_size
, sizeof(struct s1
) == 12);
27 check(s2_size
, sizeof(struct s2
) == 8);
28 check(s2_offset_0
, __builtin_offsetof(struct s2
, field0
) == 0);
29 check(s2_offset_1
, __builtin_offsetof(struct s2
, field2
) == 7);
31 check(s2_size
, sizeof(struct s2
) == 6);
32 check(s2_offset_0
, __builtin_offsetof(struct s2
, field0
) == 0);
33 check(s2_offset_1
, __builtin_offsetof(struct s2
, field2
) == 5);
38 int field1
: 24 __attribute__((aligned(4)));
41 check(s3_size
, sizeof(struct s3
) == 8);
42 check(s3_offset_0
, __builtin_offsetof(struct s3
, field0
) == 0);
43 check(s3_offset_1
, __builtin_offsetof(struct s3
, field2
) == 7);
49 check(s4_size
, sizeof(struct s4
) == 4);
50 check(s4_align
, __alignof(struct s4
) == 4);
52 check(s4_size
, sizeof(struct s4
) == 1);
53 check(s4_align
, __alignof(struct s4
) == 1);