|
3 | 3 |
|
4 | 4 | #ifdef __GNUC__
|
5 | 5 |
|
6 |
| -char __attribute__((aligned(8))) var1; |
7 |
| -__attribute__((aligned(8))) char var2; |
8 |
| -char var3 __attribute__((aligned(8))); |
9 |
| -int (__attribute__((aligned(8))) var4); |
10 |
| -int (__attribute__((aligned(8))) (var5)); |
11 |
| -int (__attribute__((aligned(8))) *var6); |
12 |
| -int __attribute__((aligned(8))) *var7; |
| 6 | +char __attribute__((aligned(16))) var1; |
| 7 | +__attribute__((aligned(16))) char var2; |
| 8 | +char var3 __attribute__((aligned(16))); |
| 9 | +int (__attribute__((aligned(16))) var4); |
| 10 | +int (__attribute__((aligned(16))) (var5)); |
| 11 | +int (__attribute__((aligned(16))) *var6); |
| 12 | +int __attribute__((aligned(16))) *var7; |
| 13 | +__attribute__((aligned(16))) int *var8; |
13 | 14 |
|
14 |
| -STATIC_ASSERT(__alignof(var1)==8); |
15 |
| -STATIC_ASSERT(__alignof(var2)==8); |
16 |
| -STATIC_ASSERT(__alignof(var3)==8); |
17 |
| -STATIC_ASSERT(__alignof(var4)==8); |
18 |
| -STATIC_ASSERT(__alignof(var5)==8); |
| 15 | +STATIC_ASSERT(__alignof(var1)==16); |
| 16 | +STATIC_ASSERT(__alignof(var2)==16); |
| 17 | +STATIC_ASSERT(__alignof(var3)==16); |
| 18 | +STATIC_ASSERT(__alignof(var4)==16); |
| 19 | +STATIC_ASSERT(__alignof(var5)==16); |
| 20 | +#ifdef __clang__ |
| 21 | +STATIC_ASSERT(__alignof(var6)==16); |
| 22 | +STATIC_ASSERT(__alignof(*var6)==__alignof(int)); |
| 23 | +#else |
19 | 24 | STATIC_ASSERT(__alignof(var6)==__alignof(void *));
|
20 |
| -STATIC_ASSERT(__alignof(var7)==8); |
| 25 | +STATIC_ASSERT(__alignof(*var6)==16); |
| 26 | +#endif |
| 27 | +STATIC_ASSERT(__alignof(var7)==16); |
| 28 | +STATIC_ASSERT(__alignof(var8)==16); |
21 | 29 |
|
22 | 30 | void (__attribute__((aligned)) *****f1)(void);
|
23 | 31 | void (__attribute__((aligned)) f2)(void);
|
|
0 commit comments