1
- // RUN: %clang_cc1 %s -Wno-uninitialized -std=c++14 -fsyntax-only -verify
1
+ // RUN: %clang_cc1 %s -triple x86_64-linux-gnu - Wno-uninitialized -std=c++14 -fsyntax-only -verify
2
2
3
3
// expected-no-diagnostics
4
4
@@ -156,11 +156,11 @@ void CharUsage() {
156
156
constexpr auto a = FourCharsVecSize{6 , 3 , 2 , 1 } +
157
157
FourCharsVecSize{12 , 15 , 5 , 7 };
158
158
static_assert (a[0 ] == 18 && a[1 ] == 18 && a[2 ] == 7 && a[3 ] == 8 , " " );
159
-
159
+
160
160
constexpr auto b = FourCharsVecSize{19 , 15 , 13 , 12 } -
161
161
FourCharsVecSize{13 , 14 , 5 , 3 };
162
162
static_assert (b[0 ] == 6 && b[1 ] == 1 && b[2 ] == 8 && b[3 ] == 9 , " " );
163
-
163
+
164
164
constexpr auto c = FourCharsVecSize{8 , 4 , 2 , 1 } *
165
165
FourCharsVecSize{3 , 4 , 5 , 6 };
166
166
static_assert (c[0 ] == 24 && c[1 ] == 16 && c[2 ] == 10 && c[3 ] == 6 , " " );
@@ -175,13 +175,13 @@ void CharUsage() {
175
175
176
176
constexpr auto f = FourCharsVecSize{6 , 3 , 2 , 1 } + 3 ;
177
177
static_assert (f[0 ] == 9 && f[1 ] == 6 && f[2 ] == 5 && f[3 ] == 4 , " " );
178
-
178
+
179
179
constexpr auto g = FourCharsVecSize{19 , 15 , 12 , 10 } - 3 ;
180
- static_assert (g[0 ] == 16 && g[1 ] == 12 && g[2 ] == 9 && g[3 ] == 7 , " " );
180
+ static_assert (g[0 ] == 16 && g[1 ] == 12 && g[2 ] == 9 && g[3 ] == 7 , " " );
181
181
182
182
constexpr auto h = FourCharsVecSize{8 , 4 , 2 , 1 } * 3 ;
183
183
static_assert (h[0 ] == 24 && h[1 ] == 12 && h[2 ] == 6 && h[3 ] == 3 , " " );
184
-
184
+
185
185
constexpr auto j = FourCharsVecSize{12 , 15 , 18 , 21 } / 3 ;
186
186
static_assert (j[0 ] == 4 && j[1 ] == 5 && j[2 ] == 6 && j[3 ] == 7 , " " );
187
187
@@ -193,7 +193,7 @@ void CharUsage() {
193
193
194
194
constexpr auto m = 20 - FourCharsVecSize{19 , 15 , 12 , 10 };
195
195
static_assert (m[0 ] == 1 && m[1 ] == 5 && m[2 ] == 8 && m[3 ] == 10 , " " );
196
-
196
+
197
197
constexpr auto n = 3 * FourCharsVecSize{8 , 4 , 2 , 1 };
198
198
static_assert (n[0 ] == 24 && n[1 ] == 12 && n[2 ] == 6 && n[3 ] == 3 , " " );
199
199
@@ -254,7 +254,7 @@ void CharUsage() {
254
254
255
255
constexpr auto E = FourCharsVecSize{1 , 2 , 3 , 4 } <= 3 ;
256
256
static_assert (E[0 ] == -1 && E[1 ] == -1 && E[2 ] == -1 && E[3 ] == 0 , " " );
257
-
257
+
258
258
constexpr auto F = FourCharsVecSize{1 , 2 , 3 , 4 } >= 3 ;
259
259
static_assert (F[0 ] == 0 && F[1 ] == 0 && F[2 ] == -1 && F[3 ] == -1 , " " );
260
260
@@ -267,7 +267,7 @@ void CharUsage() {
267
267
constexpr auto I = FourCharsVecSize{1 , 2 , 3 , 4 } &
268
268
FourCharsVecSize{4 , 3 , 2 , 1 };
269
269
static_assert (I[0 ] == 0 && I[1 ] == 2 && I[2 ] == 2 && I[3 ] == 0 , " " );
270
-
270
+
271
271
constexpr auto J = FourCharsVecSize{1 , 2 , 3 , 4 } ^
272
272
FourCharsVecSize { 4 , 3 , 2 , 1 };
273
273
static_assert (J[0 ] == 5 && J[1 ] == 1 && J[2 ] == 1 && J[3 ] == 5 , " " );
@@ -288,7 +288,7 @@ void CharUsage() {
288
288
constexpr auto O = FourCharsVecSize{5 , 0 , 6 , 0 } &&
289
289
FourCharsVecSize{5 , 5 , 0 , 0 };
290
290
static_assert (O[0 ] == 1 && O[1 ] == 0 && O[2 ] == 0 && O[3 ] == 0 , " " );
291
-
291
+
292
292
constexpr auto P = FourCharsVecSize{5 , 0 , 6 , 0 } ||
293
293
FourCharsVecSize{5 , 5 , 0 , 0 };
294
294
static_assert (P[0 ] == 1 && P[1 ] == 1 && P[2 ] == 1 && P[3 ] == 0 , " " );
@@ -330,7 +330,7 @@ void CharUsage() {
330
330
static_assert (ac[0 ] == 20 && ac[1 ] == 19 && ac[2 ] == 15 && ac[3 ] == 1 , " " );
331
331
332
332
constexpr auto ad = CmpBinOr (a, b);
333
- static_assert (ad[0 ] == 22 && ad[1 ] == 19 && ad[2 ] == 15 && ad[3 ] == 9 , " " );
333
+ static_assert (ad[0 ] == 22 && ad[1 ] == 19 && ad[2 ] == 15 && ad[3 ] == 9 , " " );
334
334
335
335
constexpr auto ae = ~FourCharsVecSize{1 , 2 , 10 , 20 };
336
336
static_assert (ae[0 ] == -2 && ae[1 ] == -3 && ae[2 ] == -11 && ae[3 ] == -21 , " " );
@@ -395,7 +395,7 @@ void CharExtVecUsage() {
395
395
396
396
constexpr auto r = FourCharsExtVec{19 , 15 , 12 , 10 } >>
397
397
FourCharsExtVec{1 , 1 , 2 , 2 };
398
- static_assert (r[0 ] == 9 && r[1 ] == 7 && r[2 ] == 3 && r[3 ] == 2 , " " );
398
+ static_assert (r[0 ] == 9 && r[1 ] == 7 && r[2 ] == 3 && r[3 ] == 2 , " " );
399
399
400
400
constexpr auto s = FourCharsExtVec{6 , 3 , 5 , 10 } << 1 ;
401
401
static_assert (s[0 ] == 12 && s[1 ] == 6 && s[2 ] == 10 && s[3 ] == 20 , " " );
@@ -441,7 +441,7 @@ void CharExtVecUsage() {
441
441
442
442
constexpr auto E = FourCharsExtVec{1 , 2 , 3 , 4 } <= 3 ;
443
443
static_assert (E[0 ] == -1 && E[1 ] == -1 && E[2 ] == -1 && E[3 ] == 0 , " " );
444
-
444
+
445
445
constexpr auto F = FourCharsExtVec{1 , 2 , 3 , 4 } >= 3 ;
446
446
static_assert (F[0 ] == 0 && F[1 ] == 0 && F[2 ] == -1 && F[3 ] == -1 , " " );
447
447
@@ -462,7 +462,7 @@ void CharExtVecUsage() {
462
462
constexpr auto K = FourCharsExtVec{1 , 2 , 3 , 4 } |
463
463
FourCharsExtVec{4 , 3 , 2 , 1 };
464
464
static_assert (K[0 ] == 5 && K[1 ] == 3 && K[2 ] == 3 && K[3 ] == 5 , " " );
465
-
465
+
466
466
constexpr auto L = FourCharsExtVec{1 , 2 , 3 , 4 } & 3 ;
467
467
static_assert (L[0 ] == 1 && L[1 ] == 2 && L[2 ] == 3 && L[3 ] == 0 , " " );
468
468
@@ -549,7 +549,7 @@ void FloatUsage() {
549
549
constexpr auto g = FourFloatsVecSize{19 , 15 , 12 , 10 } - 3 ;
550
550
static_assert (g[0 ] == 1.600000e+01 && g[1 ] == 1.200000e+01 && g[2 ] == 9.000000e+00 && g[3 ] == 7.000000e+00 , " " );
551
551
552
- constexpr auto h = FourFloatsVecSize{8 , 4 , 2 , 1 } * 3 ;
552
+ constexpr auto h = FourFloatsVecSize{8 , 4 , 2 , 1 } * 3 ;
553
553
static_assert (h[0 ] == 2.400000e+01 && h[1 ] == 1.200000e+01 && h[2 ] == 6.000000e+00 && h[3 ] == 3.000000e+00 , " " );
554
554
555
555
constexpr auto j = FourFloatsVecSize{12 , 15 , 18 , 21 } / 3 ;
@@ -593,7 +593,7 @@ void FloatUsage() {
593
593
594
594
constexpr auto C = FourFloatsVecSize{1 , 2 , 3 , 4 } < 3 ;
595
595
static_assert (C[0 ] == -1 && C[1 ] == -1 && C[2 ] == 0 && C[3 ] == 0 , " " );
596
-
596
+
597
597
constexpr auto D = FourFloatsVecSize{1 , 2 , 3 , 4 } > 3 ;
598
598
static_assert (D[0 ] == 0 && D[1 ] == 0 && D[2 ] == 0 && D[3 ] == -1 , " " );
599
599
@@ -607,7 +607,7 @@ void FloatUsage() {
607
607
static_assert (G[0 ] == 0 && G[1 ] == 0 && G[2 ] == -1 && G[3 ] == 0 , " " );
608
608
609
609
constexpr auto H = FourFloatsVecSize{1 , 2 , 3 , 4 } != 3 ;
610
- static_assert (H[0 ] == -1 && H[1 ] == -1 && H[2 ] == 0 && H[3 ] == -1 , " " );
610
+ static_assert (H[0 ] == -1 && H[1 ] == -1 && H[2 ] == 0 && H[3 ] == -1 , " " );
611
611
612
612
constexpr auto O = FourFloatsVecSize{5 , 0 , 6 , 0 } &&
613
613
FourFloatsVecSize{5 , 5 , 0 , 0 };
@@ -655,7 +655,7 @@ void FloatVecUsage() {
655
655
constexpr auto c = FourFloatsVecSize{8 , 4 , 2 , 1 } *
656
656
FourFloatsVecSize{3 , 4 , 5 , 6 };
657
657
static_assert (c[0 ] == 2.400000e+01 && c[1 ] == 1.600000e+01 && c[2 ] == 1.000000e+01 && c[3 ] == 6.000000e+00 , " " );
658
-
658
+
659
659
constexpr auto d = FourFloatsVecSize{12 , 12 , 10 , 10 } /
660
660
FourFloatsVecSize{6 , 4 , 5 , 2 };
661
661
static_assert (d[0 ] == 2.000000e+00 && d[1 ] == 3.000000e+00 && d[2 ] == 2.000000e+00 && d[3 ] == 5.000000e+00 , " " );
@@ -741,14 +741,14 @@ void FloatVecUsage() {
741
741
static_assert (R[0 ] == 1 && R[1 ] == 1 && R[2 ] == 1 && R[3 ] == 1 , " " );
742
742
743
743
constexpr auto T = CmpMul (a, b);
744
- static_assert (T[0 ] == 1.080000e+02 && T[1 ] == 1.800000e+01 && T[2 ] == 5.600000e+01 && T[3 ] == 7.200000e+01 , " " );
744
+ static_assert (T[0 ] == 1.080000e+02 && T[1 ] == 1.800000e+01 && T[2 ] == 5.600000e+01 && T[3 ] == 7.200000e+01 , " " );
745
745
746
746
constexpr auto U = CmpDiv (a, b);
747
747
static_assert (CmpF (U[0 ], a[0 ] / b[0 ]) && CmpF (U[1 ], a[1 ] / b[1 ]) && CmpF (U[2 ], a[2 ] / b[2 ]) && CmpF (U[3 ], a[3 ] / b[3 ]), " " );
748
748
749
749
constexpr auto X = CmpAdd (a, b);
750
750
static_assert (X[0 ] == 2.400000e+01 && X[1 ] == 1.900000e+01 && X[2 ] == 1.500000e+01 && X[3 ] == 1.700000e+01 , " " );
751
-
751
+
752
752
constexpr auto Y = CmpSub (a, b);
753
753
static_assert (Y[0 ] == 1.200000e+01 && Y[1 ] == 1.700000e+01 && Y[2 ] == -1.000000e+00 && Y[3 ] == -1.000000e+00 , " " );
754
754
@@ -826,7 +826,7 @@ void BoolVecUsage() {
826
826
827
827
constexpr auto i = FourBoolsExtVec{true , false , true , false } ^
828
828
FourBoolsExtVec { false , false , true , true };
829
- static_assert (i[0 ] == true && i[1 ] == false && i[2 ] == false && i[3 ] == true , " " );
829
+ static_assert (i[0 ] == true && i[1 ] == false && i[2 ] == false && i[3 ] == true , " " );
830
830
831
831
constexpr auto j = !FourBoolsExtVec{true , false , true , false };
832
832
static_assert (j[0 ] == false && j[1 ] == true && j[2 ] == false && j[3 ] == true , " " );
0 commit comments