1
1
// RUN: %clang_cc1 -verify -std=c++2a -fsyntax-only -Wno-bit-int-extension %s
2
+ // RUN: %clang_cc1 -verify -std=c++2a -fsyntax-only -Wno-bit-int-extension -triple ppc64-unknown-linux %s
3
+ // RUN: %clang_cc1 -verify -std=c++2a -fsyntax-only -Wno-bit-int-extension -triple ppc64le-unknown-linux %s
2
4
3
5
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
4
6
#define LITTLE_END 1
@@ -102,13 +104,13 @@ static_assert(__builtin_bit_cast(
102
104
__builtin_shufflevector (from_vector4double_to_vector4char_var,
103
105
from_vector4double_to_vector4char_var,
104
106
0 , 1 , 2 , 3 )) ==
105
- (1 ? 0x03020100 : 0x00010203 ));
107
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
106
108
static_assert (__builtin_bit_cast(unsigned long long ,
107
109
__builtin_shufflevector (
108
110
from_vector4double_to_vector4short_var,
109
111
from_vector4double_to_vector4short_var, 0 ,
110
112
1 , 2 , 3 )) ==
111
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
113
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
112
114
constexpr vector4double from_vector4float_to_vector4double_var =
113
115
__builtin_convertvector ((vector4float){0 , 1 , 2 , 3 }, vector4double);
114
116
constexpr vector4float from_vector4float_to_vector4float_var =
@@ -131,13 +133,13 @@ static_assert(__builtin_bit_cast(unsigned,
131
133
__builtin_shufflevector (
132
134
from_vector4float_to_vector4char_var,
133
135
from_vector4float_to_vector4char_var, 0 , 1 ,
134
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
136
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
135
137
static_assert (__builtin_bit_cast(
136
138
unsigned long long ,
137
139
__builtin_shufflevector (from_vector4float_to_vector4short_var,
138
140
from_vector4float_to_vector4short_var,
139
141
0 , 1 , 2 , 3 )) ==
140
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
142
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
141
143
constexpr vector4double from_vector4long_to_vector4double_var =
142
144
__builtin_convertvector ((vector4long){0 , 1 , 2 , 3 }, vector4double);
143
145
constexpr vector4float from_vector4long_to_vector4float_var =
@@ -160,13 +162,13 @@ static_assert(__builtin_bit_cast(unsigned,
160
162
__builtin_shufflevector (
161
163
from_vector4long_to_vector4char_var,
162
164
from_vector4long_to_vector4char_var, 0 , 1 ,
163
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
165
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
164
166
static_assert (__builtin_bit_cast(
165
167
unsigned long long ,
166
168
__builtin_shufflevector (from_vector4long_to_vector4short_var,
167
169
from_vector4long_to_vector4short_var,
168
170
0 , 1 , 2 , 3 )) ==
169
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
171
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
170
172
constexpr vector4double from_vector4int_to_vector4double_var =
171
173
__builtin_convertvector ((vector4int){0 , 1 , 2 , 3 }, vector4double);
172
174
constexpr vector4float from_vector4int_to_vector4float_var =
@@ -189,13 +191,13 @@ static_assert(__builtin_bit_cast(unsigned,
189
191
__builtin_shufflevector (
190
192
from_vector4int_to_vector4char_var,
191
193
from_vector4int_to_vector4char_var, 0 , 1 ,
192
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
194
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
193
195
static_assert (__builtin_bit_cast(
194
196
unsigned long long ,
195
197
__builtin_shufflevector (from_vector4int_to_vector4short_var,
196
198
from_vector4int_to_vector4short_var,
197
199
0 , 1 , 2 , 3 )) ==
198
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
200
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
199
201
constexpr vector4double from_vector4short_to_vector4double_var =
200
202
__builtin_convertvector ((vector4short){0 , 1 , 2 , 3 }, vector4double);
201
203
constexpr vector4float from_vector4short_to_vector4float_var =
@@ -218,13 +220,13 @@ static_assert(__builtin_bit_cast(unsigned,
218
220
__builtin_shufflevector (
219
221
from_vector4short_to_vector4char_var,
220
222
from_vector4short_to_vector4char_var, 0 , 1 ,
221
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
223
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
222
224
static_assert (__builtin_bit_cast(
223
225
unsigned long long ,
224
226
__builtin_shufflevector (from_vector4short_to_vector4short_var,
225
227
from_vector4short_to_vector4short_var,
226
228
0 , 1 , 2 , 3 )) ==
227
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
229
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
228
230
constexpr vector4double from_vector4char_to_vector4double_var =
229
231
__builtin_convertvector ((vector4char){0 , 1 , 2 , 3 }, vector4double);
230
232
constexpr vector4float from_vector4char_to_vector4float_var =
@@ -247,13 +249,13 @@ static_assert(__builtin_bit_cast(unsigned,
247
249
__builtin_shufflevector (
248
250
from_vector4char_to_vector4char_var,
249
251
from_vector4char_to_vector4char_var, 0 , 1 ,
250
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
252
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
251
253
static_assert (__builtin_bit_cast(
252
254
unsigned long long ,
253
255
__builtin_shufflevector (from_vector4char_to_vector4short_var,
254
256
from_vector4char_to_vector4short_var,
255
257
0 , 1 , 2 , 3 )) ==
256
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
258
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
257
259
constexpr vector4double from_vector4BitInt8_to_vector4double_var =
258
260
__builtin_convertvector ((vector4BitInt8){0 , 1 , 2 , 3 }, vector4double);
259
261
constexpr vector4float from_vector4BitInt8_to_vector4float_var =
@@ -277,13 +279,13 @@ static_assert(__builtin_bit_cast(unsigned,
277
279
from_vector4BitInt8_to_vector4char_var,
278
280
from_vector4BitInt8_to_vector4char_var, 0 ,
279
281
1 , 2 , 3 )) ==
280
- (1 ? 0x03020100 : 0x00010203 ));
282
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
281
283
static_assert (__builtin_bit_cast(unsigned long long ,
282
284
__builtin_shufflevector (
283
285
from_vector4BitInt8_to_vector4short_var,
284
286
from_vector4BitInt8_to_vector4short_var, 0 ,
285
287
1 , 2 , 3 )) ==
286
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
288
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
287
289
constexpr vector4double from_vector4BitInt32_to_vector4double_var =
288
290
__builtin_convertvector ((vector4BitInt32){0 , 1 , 2 , 3 }, vector4double);
289
291
constexpr vector4float from_vector4BitInt32_to_vector4float_var =
@@ -307,13 +309,13 @@ static_assert(__builtin_bit_cast(unsigned,
307
309
from_vector4BitInt32_to_vector4char_var,
308
310
from_vector4BitInt32_to_vector4char_var, 0 ,
309
311
1 , 2 , 3 )) ==
310
- (1 ? 0x03020100 : 0x00010203 ));
312
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
311
313
static_assert (__builtin_bit_cast(unsigned long long ,
312
314
__builtin_shufflevector (
313
315
from_vector4BitInt32_to_vector4short_var,
314
316
from_vector4BitInt32_to_vector4short_var,
315
317
0 , 1 , 2 , 3 )) ==
316
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
318
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
317
319
constexpr vector4double from_vector4BitInt128_to_vector4double_var =
318
320
__builtin_convertvector ((vector4BitInt128){0 , 1 , 2 , 3 }, vector4double);
319
321
constexpr vector4float from_vector4BitInt128_to_vector4float_var =
@@ -337,13 +339,13 @@ static_assert(__builtin_bit_cast(unsigned,
337
339
from_vector4BitInt128_to_vector4char_var,
338
340
from_vector4BitInt128_to_vector4char_var,
339
341
0 , 1 , 2 , 3 )) ==
340
- (1 ? 0x03020100 : 0x00010203 ));
342
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
341
343
static_assert (__builtin_bit_cast(unsigned long long ,
342
344
__builtin_shufflevector (
343
345
from_vector4BitInt128_to_vector4short_var,
344
346
from_vector4BitInt128_to_vector4short_var,
345
347
0 , 1 , 2 , 3 )) ==
346
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
348
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
347
349
;
348
350
constexpr vector8double from_vector8double_to_vector8double_var =
349
351
__builtin_convertvector ((vector8double){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
@@ -377,13 +379,13 @@ static_assert(__builtin_bit_cast(
377
379
__builtin_shufflevector (from_vector8double_to_vector8char_var,
378
380
from_vector8double_to_vector8char_var,
379
381
0 , 1 , 2 , 3 )) ==
380
- (1 ? 0x03020100 : 0x00010203 ));
382
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
381
383
static_assert (__builtin_bit_cast(unsigned long long ,
382
384
__builtin_shufflevector (
383
385
from_vector8double_to_vector8short_var,
384
386
from_vector8double_to_vector8short_var, 0 ,
385
387
1 , 2 , 3 )) ==
386
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
388
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
387
389
constexpr vector8double from_vector8float_to_vector8double_var =
388
390
__builtin_convertvector ((vector8float){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
389
391
vector8double);
@@ -414,13 +416,13 @@ static_assert(__builtin_bit_cast(unsigned,
414
416
__builtin_shufflevector (
415
417
from_vector8float_to_vector8char_var,
416
418
from_vector8float_to_vector8char_var, 0 , 1 ,
417
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
419
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
418
420
static_assert (__builtin_bit_cast(
419
421
unsigned long long ,
420
422
__builtin_shufflevector (from_vector8float_to_vector8short_var,
421
423
from_vector8float_to_vector8short_var,
422
424
0 , 1 , 2 , 3 )) ==
423
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
425
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
424
426
constexpr vector8double from_vector8long_to_vector8double_var =
425
427
__builtin_convertvector ((vector8long){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
426
428
vector8double);
@@ -449,13 +451,13 @@ static_assert(__builtin_bit_cast(unsigned,
449
451
__builtin_shufflevector (
450
452
from_vector8long_to_vector8char_var,
451
453
from_vector8long_to_vector8char_var, 0 , 1 ,
452
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
454
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
453
455
static_assert (__builtin_bit_cast(
454
456
unsigned long long ,
455
457
__builtin_shufflevector (from_vector8long_to_vector8short_var,
456
458
from_vector8long_to_vector8short_var,
457
459
0 , 1 , 2 , 3 )) ==
458
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
460
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
459
461
constexpr vector8double from_vector8int_to_vector8double_var =
460
462
__builtin_convertvector ((vector8int){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
461
463
vector8double);
@@ -482,13 +484,13 @@ static_assert(__builtin_bit_cast(unsigned,
482
484
__builtin_shufflevector (
483
485
from_vector8int_to_vector8char_var,
484
486
from_vector8int_to_vector8char_var, 0 , 1 ,
485
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
487
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
486
488
static_assert (__builtin_bit_cast(
487
489
unsigned long long ,
488
490
__builtin_shufflevector (from_vector8int_to_vector8short_var,
489
491
from_vector8int_to_vector8short_var,
490
492
0 , 1 , 2 , 3 )) ==
491
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
493
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
492
494
constexpr vector8double from_vector8short_to_vector8double_var =
493
495
__builtin_convertvector ((vector8short){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
494
496
vector8double);
@@ -519,13 +521,13 @@ static_assert(__builtin_bit_cast(unsigned,
519
521
__builtin_shufflevector (
520
522
from_vector8short_to_vector8char_var,
521
523
from_vector8short_to_vector8char_var, 0 , 1 ,
522
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
524
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
523
525
static_assert (__builtin_bit_cast(
524
526
unsigned long long ,
525
527
__builtin_shufflevector (from_vector8short_to_vector8short_var,
526
528
from_vector8short_to_vector8short_var,
527
529
0 , 1 , 2 , 3 )) ==
528
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
530
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
529
531
constexpr vector8double from_vector8char_to_vector8double_var =
530
532
__builtin_convertvector ((vector8char){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
531
533
vector8double);
@@ -554,13 +556,13 @@ static_assert(__builtin_bit_cast(unsigned,
554
556
__builtin_shufflevector (
555
557
from_vector8char_to_vector8char_var,
556
558
from_vector8char_to_vector8char_var, 0 , 1 ,
557
- 2 , 3 )) == (1 ? 0x03020100 : 0x00010203 ));
559
+ 2 , 3 )) == (LITTLE_END ? 0x03020100 : 0x00010203 ));
558
560
static_assert (__builtin_bit_cast(
559
561
unsigned long long ,
560
562
__builtin_shufflevector (from_vector8char_to_vector8short_var,
561
563
from_vector8char_to_vector8short_var,
562
564
0 , 1 , 2 , 3 )) ==
563
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
565
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
564
566
constexpr vector8double from_vector8BitInt8_to_vector8double_var =
565
567
__builtin_convertvector ((vector8BitInt8){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
566
568
vector8double);
@@ -593,13 +595,13 @@ static_assert(__builtin_bit_cast(unsigned,
593
595
from_vector8BitInt8_to_vector8char_var,
594
596
from_vector8BitInt8_to_vector8char_var, 0 ,
595
597
1 , 2 , 3 )) ==
596
- (1 ? 0x03020100 : 0x00010203 ));
598
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
597
599
static_assert (__builtin_bit_cast(unsigned long long ,
598
600
__builtin_shufflevector (
599
601
from_vector8BitInt8_to_vector8short_var,
600
602
from_vector8BitInt8_to_vector8short_var, 0 ,
601
603
1 , 2 , 3 )) ==
602
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
604
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
603
605
constexpr vector8double from_vector8BitInt32_to_vector8double_var =
604
606
__builtin_convertvector ((vector8BitInt32){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
605
607
vector8double);
@@ -632,13 +634,13 @@ static_assert(__builtin_bit_cast(unsigned,
632
634
from_vector8BitInt32_to_vector8char_var,
633
635
from_vector8BitInt32_to_vector8char_var, 0 ,
634
636
1 , 2 , 3 )) ==
635
- (1 ? 0x03020100 : 0x00010203 ));
637
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
636
638
static_assert (__builtin_bit_cast(unsigned long long ,
637
639
__builtin_shufflevector (
638
640
from_vector8BitInt32_to_vector8short_var,
639
641
from_vector8BitInt32_to_vector8short_var,
640
642
0 , 1 , 2 , 3 )) ==
641
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
643
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
642
644
constexpr vector8double from_vector8BitInt128_to_vector8double_var =
643
645
__builtin_convertvector ((vector8BitInt128){0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 },
644
646
vector8double);
@@ -671,13 +673,13 @@ static_assert(__builtin_bit_cast(unsigned,
671
673
from_vector8BitInt128_to_vector8char_var,
672
674
from_vector8BitInt128_to_vector8char_var,
673
675
0 , 1 , 2 , 3 )) ==
674
- (1 ? 0x03020100 : 0x00010203 ));
676
+ (LITTLE_END ? 0x03020100 : 0x00010203 ));
675
677
static_assert (__builtin_bit_cast(unsigned long long ,
676
678
__builtin_shufflevector (
677
679
from_vector8BitInt128_to_vector8short_var,
678
680
from_vector8BitInt128_to_vector8short_var,
679
681
0 , 1 , 2 , 3 )) ==
680
- (1 ? 0x0003000200010000 : 0x0000000100020003 ));
682
+ (LITTLE_END ? 0x0003000200010000 : 0x0000000100020003 ));
681
683
;
682
684
#undef CHECK_ALL_COMBINATIONS
683
685
#undef CHECK_TO_ALL_TYPES
0 commit comments