[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Frontend / fixed_point_bit_widths.c
blobe56f787e824f24a61992dab536ead99c9f7bc8d9
1 // RUN: %clang -x c -ffixed-point -S -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=x86_64-scei-ps4 %s | FileCheck %s
3 // RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=ppc64 %s | FileCheck %s
4 // RUN: %clang -x c -ffixed-point -S -emit-llvm -o - --target=x86_64-scei-ps4 %s | FileCheck %s
6 /* Primary signed _Accum */
8 int size_SsA = sizeof(signed short _Accum);
9 int size_SA = sizeof(signed _Accum);
10 int size_SlA = sizeof(signed long _Accum);
11 int align_SsA = __alignof(signed short _Accum);
12 int align_SA = __alignof(signed _Accum);
13 int align_SlA = __alignof(signed long _Accum);
15 // CHECK: @size_SsA = {{.*}}global i{{[0-9]+}} 2
16 // CHECK-NEXT: @size_SA = {{.*}}global i{{[0-9]+}} 4
17 // CHECK-NEXT: @size_SlA = {{.*}}global i{{[0-9]+}} 8
18 // CHECK-NEXT: @align_SsA = {{.*}}global i{{[0-9]+}} 2
19 // CHECK-NEXT: @align_SA = {{.*}}global i{{[0-9]+}} 4
20 // CHECK-NEXT: @align_SlA = {{.*}}global i{{[0-9]+}} 8
22 /* Primary unsigned _Accum */
24 int size_UsA = sizeof(unsigned short _Accum);
25 int size_UA = sizeof(unsigned _Accum);
26 int size_UlA = sizeof(unsigned long _Accum);
27 int align_UsA = __alignof(unsigned short _Accum);
28 int align_UA = __alignof(unsigned _Accum);
29 int align_UlA = __alignof(unsigned long _Accum);
31 // CHECK-NEXT: @size_UsA = {{.*}}global i{{[0-9]+}} 2
32 // CHECK-NEXT: @size_UA = {{.*}}global i{{[0-9]+}} 4
33 // CHECK-NEXT: @size_UlA = {{.*}}global i{{[0-9]+}} 8
34 // CHECK-NEXT: @align_UsA = {{.*}}global i{{[0-9]+}} 2
35 // CHECK-NEXT: @align_UA = {{.*}}global i{{[0-9]+}} 4
36 // CHECK-NEXT: @align_UlA = {{.*}}global i{{[0-9]+}} 8
38 /* Primary signed _Fract */
40 int size_SsF = sizeof(signed short _Fract);
41 int size_SF = sizeof(signed _Fract);
42 int size_SlF = sizeof(signed long _Fract);
43 int align_SsF = __alignof(signed short _Fract);
44 int align_SF = __alignof(signed _Fract);
45 int align_SlF = __alignof(signed long _Fract);
47 // CHECK-NEXT: @size_SsF = {{.*}}global i{{[0-9]+}} 1
48 // CHECK-NEXT: @size_SF = {{.*}}global i{{[0-9]+}} 2
49 // CHECK-NEXT: @size_SlF = {{.*}}global i{{[0-9]+}} 4
50 // CHECK-NEXT: @align_SsF = {{.*}}global i{{[0-9]+}} 1
51 // CHECK-NEXT: @align_SF = {{.*}}global i{{[0-9]+}} 2
52 // CHECK-NEXT: @align_SlF = {{.*}}global i{{[0-9]+}} 4
54 /* Primary unsigned _Fract */
56 int size_UsF = sizeof(unsigned short _Fract);
57 int size_UF = sizeof(unsigned _Fract);
58 int size_UlF = sizeof(unsigned long _Fract);
59 int align_UsF = __alignof(unsigned short _Fract);
60 int align_UF = __alignof(unsigned _Fract);
61 int align_UlF = __alignof(unsigned long _Fract);
63 // CHECK-NEXT: @size_UsF = {{.*}}global i{{[0-9]+}} 1
64 // CHECK-NEXT: @size_UF = {{.*}}global i{{[0-9]+}} 2
65 // CHECK-NEXT: @size_UlF = {{.*}}global i{{[0-9]+}} 4
66 // CHECK-NEXT: @align_UsF = {{.*}}global i{{[0-9]+}} 1
67 // CHECK-NEXT: @align_UF = {{.*}}global i{{[0-9]+}} 2
68 // CHECK-NEXT: @align_UlF = {{.*}}global i{{[0-9]+}} 4
70 /* Aliased _Accum */
72 int size_sA = sizeof(short _Accum);
73 int size_A = sizeof(_Accum);
74 int size_lA = sizeof(long _Accum);
75 int align_sA = __alignof(short _Accum);
76 int align_A = __alignof(_Accum);
77 int align_lA = __alignof(long _Accum);
79 // CHECK-NEXT: @size_sA = {{.*}}global i{{[0-9]+}} 2
80 // CHECK-NEXT: @size_A = {{.*}}global i{{[0-9]+}} 4
81 // CHECK-NEXT: @size_lA = {{.*}}global i{{[0-9]+}} 8
82 // CHECK-NEXT: @align_sA = {{.*}}global i{{[0-9]+}} 2
83 // CHECK-NEXT: @align_A = {{.*}}global i{{[0-9]+}} 4
84 // CHECK-NEXT: @align_lA = {{.*}}global i{{[0-9]+}} 8
86 /* Aliased _Fract */
88 int size_sF = sizeof(short _Fract);
89 int size_F = sizeof(_Fract);
90 int size_lF = sizeof(long _Fract);
91 int align_sF = __alignof(short _Fract);
92 int align_F = __alignof(_Fract);
93 int align_lF = __alignof(long _Fract);
95 // CHECK-NEXT: @size_sF = {{.*}}global i{{[0-9]+}} 1
96 // CHECK-NEXT: @size_F = {{.*}}global i{{[0-9]+}} 2
97 // CHECK-NEXT: @size_lF = {{.*}}global i{{[0-9]+}} 4
98 // CHECK-NEXT: @align_sF = {{.*}}global i{{[0-9]+}} 1
99 // CHECK-NEXT: @align_F = {{.*}}global i{{[0-9]+}} 2
100 // CHECK-NEXT: @align_lF = {{.*}}global i{{[0-9]+}} 4
102 /* Saturated signed _Accum */
104 int size_SatSsA = sizeof(_Sat signed short _Accum);
105 int size_SatSA = sizeof(_Sat signed _Accum);
106 int size_SatSlA = sizeof(_Sat signed long _Accum);
107 int align_SatSsA = __alignof(_Sat signed short _Accum);
108 int align_SatSA = __alignof(_Sat signed _Accum);
109 int align_SatSlA = __alignof(_Sat signed long _Accum);
111 // CHECK: @size_SatSsA = {{.*}}global i{{[0-9]+}} 2
112 // CHECK-NEXT: @size_SatSA = {{.*}}global i{{[0-9]+}} 4
113 // CHECK-NEXT: @size_SatSlA = {{.*}}global i{{[0-9]+}} 8
114 // CHECK-NEXT: @align_SatSsA = {{.*}}global i{{[0-9]+}} 2
115 // CHECK-NEXT: @align_SatSA = {{.*}}global i{{[0-9]+}} 4
116 // CHECK-NEXT: @align_SatSlA = {{.*}}global i{{[0-9]+}} 8
118 /* Saturated unsigned _Accum */
120 int size_SatUsA = sizeof(_Sat unsigned short _Accum);
121 int size_SatUA = sizeof(_Sat unsigned _Accum);
122 int size_SatUlA = sizeof(_Sat unsigned long _Accum);
123 int align_SatUsA = __alignof(_Sat unsigned short _Accum);
124 int align_SatUA = __alignof(_Sat unsigned _Accum);
125 int align_SatUlA = __alignof(_Sat unsigned long _Accum);
127 // CHECK-NEXT: @size_SatUsA = {{.*}}global i{{[0-9]+}} 2
128 // CHECK-NEXT: @size_SatUA = {{.*}}global i{{[0-9]+}} 4
129 // CHECK-NEXT: @size_SatUlA = {{.*}}global i{{[0-9]+}} 8
130 // CHECK-NEXT: @align_SatUsA = {{.*}}global i{{[0-9]+}} 2
131 // CHECK-NEXT: @align_SatUA = {{.*}}global i{{[0-9]+}} 4
132 // CHECK-NEXT: @align_SatUlA = {{.*}}global i{{[0-9]+}} 8
134 /* Saturated signed _Fract */
136 int size_SatSsF = sizeof(_Sat signed short _Fract);
137 int size_SatSF = sizeof(_Sat signed _Fract);
138 int size_SatSlF = sizeof(_Sat signed long _Fract);
139 int align_SatSsF = __alignof(_Sat signed short _Fract);
140 int align_SatSF = __alignof(_Sat signed _Fract);
141 int align_SatSlF = __alignof(_Sat signed long _Fract);
143 // CHECK-NEXT: @size_SatSsF = {{.*}}global i{{[0-9]+}} 1
144 // CHECK-NEXT: @size_SatSF = {{.*}}global i{{[0-9]+}} 2
145 // CHECK-NEXT: @size_SatSlF = {{.*}}global i{{[0-9]+}} 4
146 // CHECK-NEXT: @align_SatSsF = {{.*}}global i{{[0-9]+}} 1
147 // CHECK-NEXT: @align_SatSF = {{.*}}global i{{[0-9]+}} 2
148 // CHECK-NEXT: @align_SatSlF = {{.*}}global i{{[0-9]+}} 4
150 /* Saturated unsigned _Fract */
152 int size_SatUsF = sizeof(_Sat unsigned short _Fract);
153 int size_SatUF = sizeof(_Sat unsigned _Fract);
154 int size_SatUlF = sizeof(_Sat unsigned long _Fract);
155 int align_SatUsF = __alignof(_Sat unsigned short _Fract);
156 int align_SatUF = __alignof(_Sat unsigned _Fract);
157 int align_SatUlF = __alignof(_Sat unsigned long _Fract);
159 // CHECK-NEXT: @size_SatUsF = {{.*}}global i{{[0-9]+}} 1
160 // CHECK-NEXT: @size_SatUF = {{.*}}global i{{[0-9]+}} 2
161 // CHECK-NEXT: @size_SatUlF = {{.*}}global i{{[0-9]+}} 4
162 // CHECK-NEXT: @align_SatUsF = {{.*}}global i{{[0-9]+}} 1
163 // CHECK-NEXT: @align_SatUF = {{.*}}global i{{[0-9]+}} 2
164 // CHECK-NEXT: @align_SatUlF = {{.*}}global i{{[0-9]+}} 4
166 /* Aliased saturated signed _Accum */
168 int size_SatsA = sizeof(_Sat short _Accum);
169 int size_SatA = sizeof(_Sat _Accum);
170 int size_SatlA = sizeof(_Sat long _Accum);
171 int align_SatsA = __alignof(_Sat short _Accum);
172 int align_SatA = __alignof(_Sat _Accum);
173 int align_SatlA = __alignof(_Sat long _Accum);
175 // CHECK-NEXT: @size_SatsA = {{.*}}global i{{[0-9]+}} 2
176 // CHECK-NEXT: @size_SatA = {{.*}}global i{{[0-9]+}} 4
177 // CHECK-NEXT: @size_SatlA = {{.*}}global i{{[0-9]+}} 8
178 // CHECK-NEXT: @align_SatsA = {{.*}}global i{{[0-9]+}} 2
179 // CHECK-NEXT: @align_SatA = {{.*}}global i{{[0-9]+}} 4
180 // CHECK-NEXT: @align_SatlA = {{.*}}global i{{[0-9]+}} 8
182 /* Aliased saturated _Fract */
184 int size_SatsF = sizeof(_Sat short _Fract);
185 int size_SatF = sizeof(_Sat _Fract);
186 int size_SatlF = sizeof(_Sat long _Fract);
187 int align_SatsF = __alignof(_Sat short _Fract);
188 int align_SatF = __alignof(_Sat _Fract);
189 int align_SatlF = __alignof(_Sat long _Fract);
191 // CHECK-NEXT: @size_SatsF = {{.*}}global i{{[0-9]+}} 1
192 // CHECK-NEXT: @size_SatF = {{.*}}global i{{[0-9]+}} 2
193 // CHECK-NEXT: @size_SatlF = {{.*}}global i{{[0-9]+}} 4
194 // CHECK-NEXT: @align_SatsF = {{.*}}global i{{[0-9]+}} 1
195 // CHECK-NEXT: @align_SatF = {{.*}}global i{{[0-9]+}} 2
196 // CHECK-NEXT: @align_SatlF = {{.*}}global i{{[0-9]+}} 4