This source file includes following definitions.
- main
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 #include <config.h>
20
21 #include <stddef.h>
22 #include <limits.h>
23 #include <stdalign.h>
24 #include "verify.h"
25
26
27 wchar_t a = 'c';
28 ptrdiff_t b = 1;
29 size_t c = 2;
30 max_align_t x;
31
32
33
34 verify (sizeof NULL == sizeof (void *));
35
36
37 struct d
38 {
39 char e;
40 char f;
41 };
42
43
44
45
46 verify (sizeof (offsetof (struct d, e)) == sizeof (size_t));
47 verify (offsetof (struct d, f) == 1);
48
49
50
51 verify ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1));
52
53
54 verify (alignof (double) <= alignof (max_align_t));
55 verify (alignof (int) <= alignof (max_align_t));
56 verify (alignof (long double) <= alignof (max_align_t));
57 verify (alignof (long int) <= alignof (max_align_t));
58 verify (alignof (ptrdiff_t) <= alignof (max_align_t));
59 verify (alignof (size_t) <= alignof (max_align_t));
60 verify (alignof (wchar_t) <= alignof (max_align_t));
61 verify (alignof (struct d) <= alignof (max_align_t));
62 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
63 verify (__alignof__ (double) <= __alignof__ (max_align_t));
64 verify (__alignof__ (int) <= __alignof__ (max_align_t));
65 verify (__alignof__ (long double) <= __alignof__ (max_align_t));
66 verify (__alignof__ (long int) <= __alignof__ (max_align_t));
67 verify (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t));
68 verify (__alignof__ (size_t) <= __alignof__ (max_align_t));
69 verify (__alignof__ (wchar_t) <= __alignof__ (max_align_t));
70 verify (__alignof__ (struct d) <= __alignof__ (max_align_t));
71 #endif
72
73 int
74 main (void)
75 {
76 return 0;
77 }