[clang-cl] Ignore /Wv and /Wv:17 flags
[llvm-project.git] / clang / test / Sema / zvector.c
blob798b12bd50b767d3566ebb999664c5cf1e7d78b7
1 // RUN: %clang_cc1 -triple s390x-linux-gnu -fzvector \
2 // RUN: -flax-vector-conversions=none -W -Wall -Wconversion \
3 // RUN: -Werror -fsyntax-only -verify %s
5 vector signed char sc, sc2;
6 vector unsigned char uc, uc2;
7 vector bool char bc, bc2;
9 vector signed short ss, ss2;
10 vector unsigned short us, us2;
11 vector bool short bs, bs2;
13 vector signed int si, si2;
14 vector unsigned int ui, ui2;
15 vector bool int bi, bi2;
17 vector signed long long sl, sl2;
18 vector unsigned long long ul, ul2;
19 vector bool long long bl, bl2;
21 vector double fd, fd2;
23 vector long ll; // expected-error {{cannot use 'long' with '__vector'}}
24 vector float ff; // expected-error {{cannot use 'float' with '__vector'}}
26 signed char sc_scalar;
27 unsigned char uc_scalar;
29 signed short ss_scalar;
30 unsigned short us_scalar;
32 signed int si_scalar;
33 unsigned int ui_scalar;
35 signed long sl_scalar;
36 unsigned long ul_scalar;
38 double fd_scalar;
40 // Verify that __vector is also recognized
41 __vector signed char sc3;
42 __vector unsigned char uc3;
43 __vector bool char bc3;
44 __vector signed short ss3;
45 __vector unsigned short us3;
46 __vector bool short bs3;
47 __vector signed int si3;
48 __vector unsigned int ui3;
49 __vector bool int bi3;
50 __vector signed long long sl3;
51 __vector unsigned long long ul3;
52 __vector bool long long bl3;
53 __vector double fd3;
54 __vector long ll3; // expected-error {{cannot use 'long' with '__vector'}}
55 __vector float ff3; // expected-error {{cannot use 'float' with '__vector'}}
57 // Likewise for __bool
58 vector __bool char bc4;
59 vector __bool short bs4;
60 vector __bool int bi4;
61 vector __bool long long bl4;
62 __vector __bool char bc5;
63 __vector __bool short bs5;
64 __vector __bool int bi5;
65 __vector __bool long long bl5;
67 // Verify operation of vec_step
68 int res_sc[vec_step(sc) == 16 ? 1 : -1];
69 int res_uc[vec_step(uc) == 16 ? 1 : -1];
70 int res_bc[vec_step(bc) == 16 ? 1 : -1];
71 int res_ss[vec_step(ss) == 8 ? 1 : -1];
72 int res_us[vec_step(us) == 8 ? 1 : -1];
73 int res_bs[vec_step(bs) == 8 ? 1 : -1];
74 int res_si[vec_step(si) == 4 ? 1 : -1];
75 int res_ui[vec_step(ui) == 4 ? 1 : -1];
76 int res_bi[vec_step(bi) == 4 ? 1 : -1];
77 int res_sl[vec_step(sl) == 2 ? 1 : -1];
78 int res_ul[vec_step(ul) == 2 ? 1 : -1];
79 int res_bl[vec_step(bl) == 2 ? 1 : -1];
80 int res_fd[vec_step(fd) == 2 ? 1 : -1];
83 void foo(void)
85 // -------------------------------------------------------------------------
86 // Test assignment.
87 // -------------------------------------------------------------------------
89 sc = sc2;
90 uc = uc2;
91 bc = bc2;
93 ss = ss2;
94 us = us2;
95 bs = bs2;
97 si = si2;
98 ui = ui2;
99 bi = bi2;
101 sl = sl2;
102 ul = ul2;
103 bl = bl2;
104 fd = fd2;
106 sc = uc2; // expected-error {{incompatible type}}
107 sc = bc2; // expected-error {{incompatible type}}
108 uc = sc2; // expected-error {{incompatible type}}
109 uc = bc2; // expected-error {{incompatible type}}
110 bc = sc2; // expected-error {{incompatible type}}
111 bc = uc2; // expected-error {{incompatible type}}
113 sc = sc_scalar; // expected-error {{incompatible type}}
114 sc = uc_scalar; // expected-error {{incompatible type}}
115 uc = sc_scalar; // expected-error {{incompatible type}}
116 uc = uc_scalar; // expected-error {{incompatible type}}
117 bc = sc_scalar; // expected-error {{incompatible type}}
118 bc = uc_scalar; // expected-error {{incompatible type}}
120 sc = ss2; // expected-error {{incompatible type}}
121 sc = si2; // expected-error {{incompatible type}}
122 sc = sl2; // expected-error {{incompatible type}}
123 sc = fd2; // expected-error {{incompatible type}}
125 ss = sc2; // expected-error {{incompatible type}}
126 si = sc2; // expected-error {{incompatible type}}
127 sl = sc2; // expected-error {{incompatible type}}
128 fd = sc2; // expected-error {{incompatible type}}
130 uc = us2; // expected-error {{incompatible type}}
131 uc = ui2; // expected-error {{incompatible type}}
132 uc = ul2; // expected-error {{incompatible type}}
133 uc = fd2; // expected-error {{incompatible type}}
135 us = uc2; // expected-error {{incompatible type}}
136 ui = uc2; // expected-error {{incompatible type}}
137 ul = uc2; // expected-error {{incompatible type}}
138 fd = uc2; // expected-error {{incompatible type}}
140 bc = us2; // expected-error {{incompatible type}}
141 bc = ui2; // expected-error {{incompatible type}}
142 bc = ul2; // expected-error {{incompatible type}}
143 bc = fd2; // expected-error {{incompatible type}}
145 bs = bc2; // expected-error {{incompatible type}}
146 bi = bc2; // expected-error {{incompatible type}}
147 bl = bc2; // expected-error {{incompatible type}}
148 fd = bc2; // expected-error {{incompatible type}}
150 // -------------------------------------------------------------------------
151 // Test casts to same element width.
152 // -------------------------------------------------------------------------
154 sc = (vector signed char)bc2;
155 bc = (vector bool char)uc2;
156 uc = (vector unsigned char)sc2;
158 ss = (vector signed short)bs2;
159 bs = (vector bool short)us2;
160 us = (vector unsigned short)ss2;
162 si = (vector signed int)bi2;
163 bi = (vector bool int)ui2;
164 ui = (vector unsigned int)si2;
166 sl = (vector signed long long)bl2;
167 bl = (vector bool long long)ul2;
168 ul = (vector unsigned long long)fd2;
169 fd = (vector double)sl2;
171 // -------------------------------------------------------------------------
172 // Test casts to different element width.
173 // -------------------------------------------------------------------------
175 sc = (vector signed char)bs2;
176 bc = (vector bool char)us2;
177 uc = (vector unsigned char)fd2;
179 ss = (vector signed short)bi2;
180 bs = (vector bool short)ui2;
181 us = (vector unsigned short)fd2;
183 si = (vector signed int)bl2;
184 bi = (vector bool int)ul2;
185 ui = (vector unsigned int)fd2;
187 sl = (vector signed long long)bc2;
188 bl = (vector bool long long)uc2;
189 ul = (vector unsigned long long)sc2;
190 fd = (vector double)sc2;
192 // -------------------------------------------------------------------------
193 // Test ++.
194 // -------------------------------------------------------------------------
196 ++sc2;
197 ++uc2;
198 ++bc2; // expected-error {{cannot increment}}
200 ++ss2;
201 ++us2;
202 ++bs2; // expected-error {{cannot increment}}
204 ++si2;
205 ++ui2;
206 ++bi2; // expected-error {{cannot increment}}
208 ++sl2;
209 ++ul2;
210 ++bl2; // expected-error {{cannot increment}}
212 ++fd2;
214 sc++;
215 uc++;
216 bc++; // expected-error {{cannot increment}}
218 ss++;
219 us++;
220 bs++; // expected-error {{cannot increment}}
222 si++;
223 ui++;
224 bi++; // expected-error {{cannot increment}}
226 sl++;
227 ul++;
228 bl++; // expected-error {{cannot increment}}
230 fd++;
232 // -------------------------------------------------------------------------
233 // Test --.
234 // -------------------------------------------------------------------------
236 --sc2;
237 --uc2;
238 --bc2; // expected-error {{cannot decrement}}
240 --ss2;
241 --us2;
242 --bs2; // expected-error {{cannot decrement}}
244 --si2;
245 --ui2;
246 --bi2; // expected-error {{cannot decrement}}
248 --sl2;
249 --ul2;
250 --bl2; // expected-error {{cannot decrement}}
252 --fd2;
254 sc--;
255 uc--;
256 bc--; // expected-error {{cannot decrement}}
258 ss--;
259 us--;
260 bs--; // expected-error {{cannot decrement}}
262 si--;
263 ui--;
264 bi--; // expected-error {{cannot decrement}}
266 sl--;
267 ul--;
268 bl--; // expected-error {{cannot decrement}}
270 fd--;
272 // -------------------------------------------------------------------------
273 // Test unary +.
274 // -------------------------------------------------------------------------
276 sc = +sc2;
277 uc = +uc2;
278 bc = +bc2; // expected-error {{invalid argument type}}
280 ss = +ss2;
281 us = +us2;
282 bs = +bs2; // expected-error {{invalid argument type}}
284 si = +si2;
285 ui = +ui2;
286 bi = +bi2; // expected-error {{invalid argument type}}
288 sl = +sl2;
289 ul = +ul2;
290 bl = +bl2; // expected-error {{invalid argument type}}
292 fd = +fd2;
294 sc = +si2; // expected-error {{assigning to}}
295 ui = +si2; // expected-error {{assigning to}}
296 ui = +bi2; // expected-error {{invalid argument type}}
298 // -------------------------------------------------------------------------
299 // Test unary -.
300 // -------------------------------------------------------------------------
302 sc = -sc2;
303 uc = -uc2;
304 bc = -bc2; // expected-error {{invalid argument type}}
306 ss = -ss2;
307 us = -us2;
308 bs = -bs2; // expected-error {{invalid argument type}}
310 si = -si2;
311 ui = -ui2;
312 bi = -bi2; // expected-error {{invalid argument type}}
314 sl = -sl2;
315 ul = -ul2;
316 bl = -bl2; // expected-error {{invalid argument type}}
318 fd = -fd2;
320 sc = -si2; // expected-error {{assigning to}}
321 ui = -si2; // expected-error {{assigning to}}
322 ui = -bi2; // expected-error {{invalid argument type}}
324 // -------------------------------------------------------------------------
325 // Test ~.
326 // -------------------------------------------------------------------------
328 sc = ~sc2;
329 uc = ~uc2;
330 bc = ~bc2;
332 ss = ~ss2;
333 us = ~us2;
334 bs = ~bs2;
336 si = ~si2;
337 ui = ~ui2;
338 bi = ~bi2;
340 sl = ~sl2;
341 ul = ~ul2;
342 bl = ~bl2;
344 fd = ~fd2; // expected-error {{invalid argument}}
346 sc = ~si2; // expected-error {{assigning to}}
347 ui = ~si2; // expected-error {{assigning to}}
348 ui = ~bi2; // expected-error {{assigning to}}
350 // -------------------------------------------------------------------------
351 // Test binary +.
352 // -------------------------------------------------------------------------
354 sc = sc + sc2;
355 sc = sc + uc2; // expected-error {{cannot convert}}
356 sc = uc + sc2; // expected-error {{cannot convert}}
357 sc = sc + bc2;
358 sc = bc + sc2;
360 uc = uc + uc2;
361 uc = sc + uc2; // expected-error {{cannot convert}}
362 uc = uc + sc2; // expected-error {{cannot convert}}
363 uc = bc + uc2;
364 uc = uc + bc2;
366 bc = bc + bc2; // expected-error {{invalid operands}}
367 bc = bc + uc2; // expected-error {{incompatible type}}
368 bc = uc + bc2; // expected-error {{incompatible type}}
369 bc = bc + sc2; // expected-error {{incompatible type}}
370 bc = sc + bc2; // expected-error {{incompatible type}}
372 sc = sc + sc_scalar;
373 sc = sc + uc_scalar; // expected-error {{cannot convert between scalar type 'unsigned char' and vector type '__vector signed char' (vector of 16 'signed char' values) as implicit conversion would cause truncation}}
374 sc = sc_scalar + sc;
375 sc = uc_scalar + sc; // expected-error {{cannot convert between scalar type 'unsigned char' and vector type '__vector signed char' (vector of 16 'signed char' values) as implicit conversion would cause truncation}}
376 uc = uc + sc_scalar; // expected-error {{implicit conversion changes signedness: 'signed char' to '__vector unsigned char' (vector of 16 'unsigned char' values)}}
377 uc = uc + uc_scalar;
378 uc = sc_scalar + uc; // expected-error {{implicit conversion changes signedness: 'signed char' to '__vector unsigned char' (vector of 16 'unsigned char' values)}}
379 uc = uc_scalar + uc;
381 ss = ss + ss2;
382 us = us + us2;
383 bs = bs + bs2; // expected-error {{invalid operands}}
385 si = si + si2;
386 ui = ui + ui2;
387 bi = bi + bi2; // expected-error {{invalid operands}}
389 sl = sl + sl2;
390 ul = ul + ul2;
391 bl = bl + bl2; // expected-error {{invalid operands}}
393 fd = fd + fd2;
394 fd = fd + ul2; // expected-error {{cannot convert}}
395 fd = sl + fd2; // expected-error {{cannot convert}}
397 sc += sc2;
398 sc += uc2; // expected-error {{cannot convert}}
399 sc += bc2;
401 uc += uc2;
402 uc += sc2; // expected-error {{cannot convert}}
403 uc += bc2;
405 bc += bc2; // expected-error {{invalid operands}}
406 bc += sc2; // expected-error {{cannot convert}}
407 bc += uc2; // expected-error {{cannot convert}}
409 sc += ss2; // expected-error {{cannot convert}}
410 sc += si2; // expected-error {{cannot convert}}
411 sc += sl2; // expected-error {{cannot convert}}
412 sc += fd2; // expected-error {{cannot convert}}
414 sc += sc_scalar;
415 sc += uc_scalar; // expected-error {{cannot convert between scalar type 'unsigned char' and vector type '__vector signed char' (vector of 16 'signed char' values) as implicit conversion would cause truncation}}
416 uc += sc_scalar; // expected-error {{implicit conversion changes signedness: 'signed char' to '__vector unsigned char' (vector of 16 'unsigned char' values)}}
417 uc += uc_scalar;
419 ss += ss2;
420 us += us2;
421 bs += bs2; // expected-error {{invalid operands}}
423 si += si2;
424 ui += ui2;
425 bi += bi2; // expected-error {{invalid operands}}
427 sl += sl2;
428 ul += ul2;
429 bl += bl2; // expected-error {{invalid operands}}
431 fd += fd2;
433 // -------------------------------------------------------------------------
434 // Test that binary + rules apply to binary - too.
435 // -------------------------------------------------------------------------
437 sc = sc - sc2;
438 uc = uc - uc2;
439 bc = bc - bc2; // expected-error {{invalid operands}}
441 sc = uc - sc2; // expected-error {{cannot convert}}
442 sc = sc - bc2;
443 uc = bc - uc2;
445 sc -= sc2;
446 uc -= uc2;
447 bc -= bc2; // expected-error {{invalid operands}}
449 sc -= uc2; // expected-error {{cannot convert}}
450 uc -= bc2;
451 bc -= sc2; // expected-error {{cannot convert}}
453 ss -= ss2;
454 us -= us2;
455 bs -= bs2; // expected-error {{invalid operands}}
457 si -= si2;
458 ui -= ui2;
459 bi -= bi2; // expected-error {{invalid operands}}
461 sl -= sl2;
462 ul -= ul2;
463 bl -= bl2; // expected-error {{invalid operands}}
465 fd -= fd2;
467 // -------------------------------------------------------------------------
468 // Test that binary + rules apply to * too. 64-bit integer multiplication
469 // is not required by the spec and so isn't tested here.
470 // -------------------------------------------------------------------------
472 sc = sc * sc2;
473 uc = uc * uc2;
474 bc = bc * bc2; // expected-error {{invalid operands}}
476 sc = uc * sc2; // expected-error {{cannot convert}}
477 sc = sc * bc2; // expected-error {{cannot convert}}
478 uc = bc * uc2; // expected-error {{cannot convert}}
480 sc *= sc2;
481 uc *= uc2;
482 bc *= bc2; // expected-error {{invalid operands}}
484 sc *= uc2; // expected-error {{cannot convert}}
485 uc *= bc2; // expected-error {{cannot convert}}
486 bc *= sc2; // expected-error {{cannot convert}}
488 ss *= ss2;
489 us *= us2;
490 bs *= bs2; // expected-error {{invalid operands}}
492 si *= si2;
493 ui *= ui2;
494 bi *= bi2; // expected-error {{invalid operands}}
496 sl *= sl2;
497 ul *= ul2;
498 bl *= bl2; // expected-error {{invalid operands}}
500 fd *= fd2;
502 // -------------------------------------------------------------------------
503 // Test that * rules apply to / too.
504 // -------------------------------------------------------------------------
506 sc = sc / sc2;
507 uc = uc / uc2;
508 bc = bc / bc2; // expected-error {{invalid operands}}
510 sc = uc / sc2; // expected-error {{cannot convert}}
511 sc = sc / bc2; // expected-error {{cannot convert}}
512 uc = bc / uc2; // expected-error {{cannot convert}}
514 sc /= sc2;
515 uc /= uc2;
516 bc /= bc2; // expected-error {{invalid operands}}
518 sc /= uc2; // expected-error {{cannot convert}}
519 uc /= bc2; // expected-error {{cannot convert}}
520 bc /= sc2; // expected-error {{cannot convert}}
522 ss /= ss2;
523 us /= us2;
524 bs /= bs2; // expected-error {{invalid operands}}
526 si /= si2;
527 ui /= ui2;
528 bi /= bi2; // expected-error {{invalid operands}}
530 sl /= sl2;
531 ul /= ul2;
532 bl /= bl2; // expected-error {{invalid operands}}
534 fd /= fd2;
536 // -------------------------------------------------------------------------
537 // Test that / rules apply to % too, except that doubles are not allowed.
538 // -------------------------------------------------------------------------
540 sc = sc % sc2;
541 uc = uc % uc2;
542 bc = bc % bc2; // expected-error {{invalid operands}}
544 sc = uc % sc2; // expected-error {{cannot convert}}
545 sc = sc % bc2; // expected-error {{cannot convert}}
546 uc = bc % uc2; // expected-error {{cannot convert}}
548 sc %= sc2;
549 uc %= uc2;
550 bc %= bc2; // expected-error {{invalid operands}}
552 sc %= uc2; // expected-error {{cannot convert}}
553 uc %= bc2; // expected-error {{cannot convert}}
554 bc %= sc2; // expected-error {{cannot convert}}
556 ss %= ss2;
557 us %= us2;
558 bs %= bs2; // expected-error {{invalid operands}}
560 si %= si2;
561 ui %= ui2;
562 bi %= bi2; // expected-error {{invalid operands}}
564 sl %= sl2;
565 ul %= ul2;
566 bl %= bl2; // expected-error {{invalid operands}}
568 fd %= fd2; // expected-error {{invalid operands}}
570 // -------------------------------------------------------------------------
571 // Test &.
572 // -------------------------------------------------------------------------
574 sc = sc & sc2;
575 sc = sc & uc2; // expected-error {{cannot convert}}
576 sc = uc & sc2; // expected-error {{cannot convert}}
577 sc = sc & bc2;
578 sc = bc & sc2;
580 uc = uc & uc2;
581 uc = sc & uc2; // expected-error {{cannot convert}}
582 uc = uc & sc2; // expected-error {{cannot convert}}
583 uc = bc & uc2;
584 uc = uc & bc2;
586 bc = bc & bc2;
587 bc = bc & uc2; // expected-error {{incompatible type}}
588 bc = uc & bc2; // expected-error {{incompatible type}}
589 bc = bc & sc2; // expected-error {{incompatible type}}
590 bc = sc & bc2; // expected-error {{incompatible type}}
592 fd = fd & fd2; // expected-error {{invalid operands}}
593 fd = bl & fd2; // expected-error {{invalid operands}}
594 fd = fd & bl2; // expected-error {{invalid operands}}
595 fd = fd & sl2; // expected-error {{invalid operands}}
596 fd = fd & ul2; // expected-error {{invalid operands}}
598 sc &= sc2;
599 sc &= uc2; // expected-error {{cannot convert}}
600 sc &= bc2;
602 uc &= uc2;
603 uc &= sc2; // expected-error {{cannot convert}}
604 uc &= bc2;
606 bc &= bc2;
607 bc &= sc2; // expected-error {{cannot convert}}
608 bc &= uc2; // expected-error {{cannot convert}}
610 sc &= ss2; // expected-error {{cannot convert}}
611 sc &= si2; // expected-error {{cannot convert}}
612 sc &= sl2; // expected-error {{cannot convert}}
613 sc &= fd2; // expected-error {{invalid operands}}
615 us &= bc2; // expected-error {{cannot convert}}
616 ui &= bc2; // expected-error {{cannot convert}}
617 ul &= bc2; // expected-error {{cannot convert}}
618 fd &= bc2; // expected-error {{invalid operands}}
620 ss &= ss2;
621 us &= us2;
622 bs &= bs2;
624 si &= si2;
625 ui &= ui2;
626 bi &= bi2;
628 sl &= sl2;
629 ul &= ul2;
630 bl &= bl2;
632 // -------------------------------------------------------------------------
633 // Test that & rules apply to | too.
634 // -------------------------------------------------------------------------
636 sc = sc | sc2;
637 sc = sc | uc2; // expected-error {{cannot convert}}
638 sc = sc | bc2;
640 uc = uc | uc2;
641 uc = sc | uc2; // expected-error {{cannot convert}}
642 uc = bc | uc2;
644 bc = bc | bc2;
645 bc = uc | bc2; // expected-error {{incompatible type}}
646 bc = bc | sc2; // expected-error {{incompatible type}}
648 fd = fd | fd2; // expected-error {{invalid operands}}
649 fd = bl | fd2; // expected-error {{invalid operands}}
651 ss |= ss2;
652 us |= us2;
653 bs |= bs2;
655 si |= si2;
656 ui |= ui2;
657 bi |= bi2;
659 sl |= sl2;
660 ul |= ul2;
661 bl |= bl2;
663 fd |= bl2; // expected-error {{invalid operands}}
664 fd |= fd2; // expected-error {{invalid operands}}
666 // -------------------------------------------------------------------------
667 // Test that & rules apply to ^ too.
668 // -------------------------------------------------------------------------
670 sc = sc ^ sc2;
671 sc = sc ^ uc2; // expected-error {{cannot convert}}
672 sc = sc ^ bc2;
674 uc = uc ^ uc2;
675 uc = sc ^ uc2; // expected-error {{cannot convert}}
676 uc = bc ^ uc2;
678 bc = bc ^ bc2;
679 bc = uc ^ bc2; // expected-error {{incompatible type}}
680 bc = bc ^ sc2; // expected-error {{incompatible type}}
682 fd = fd ^ fd2; // expected-error {{invalid operands}}
683 fd = bl ^ fd2; // expected-error {{invalid operands}}
685 ss ^= ss2;
686 us ^= us2;
687 bs ^= bs2;
689 si ^= si2;
690 ui ^= ui2;
691 bi ^= bi2;
693 sl ^= sl2;
694 ul ^= ul2;
695 bl ^= bl2;
697 fd ^= bl2; // expected-error {{invalid operands}}
698 fd ^= fd2; // expected-error {{invalid operands}}
700 // -------------------------------------------------------------------------
701 // Test <<.
702 // -------------------------------------------------------------------------
704 sc = sc << sc2;
705 sc = sc << uc2;
706 sc = uc << sc2; // expected-error {{incompatible type}}
707 sc = sc << bc2; // expected-error {{invalid operands}}
708 sc = bc << sc2; // expected-error {{invalid operands}}
710 uc = uc << uc2;
711 uc = sc << uc2; // expected-error {{assigning to}}
712 uc = uc << sc2;
713 uc = bc << uc2; // expected-error {{invalid operands}}
714 uc = uc << bc2; // expected-error {{invalid operands}}
716 bc = bc << bc2; // expected-error {{invalid operands}}
717 bc = bc << uc2; // expected-error {{invalid operands}}
718 bc = uc << bc2; // expected-error {{invalid operands}}
719 bc = bc << sc2; // expected-error {{invalid operands}}
720 bc = sc << bc2; // expected-error {{invalid operands}}
722 sc = sc << 1;
723 sc = sc << 1.0f; // expected-error {{integer is required}}
724 sc = sc << sc_scalar;
725 sc = sc << uc_scalar;
726 sc = sc << ss_scalar;
727 sc = sc << us_scalar;
728 sc = sc << si_scalar;
729 sc = sc << ui_scalar;
730 sc = sc << sl_scalar;
731 sc = sc << ul_scalar;
732 sc = sc_scalar << sc; // expected-error {{first operand is not a vector}}
733 sc = uc_scalar << sc; // expected-error {{first operand is not a vector}}
734 uc = uc << sc_scalar;
735 uc = uc << uc_scalar;
736 uc = sc_scalar << uc; // expected-error {{first operand is not a vector}}
737 uc = uc_scalar << uc; // expected-error {{first operand is not a vector}}
739 ss = ss << ss2;
740 ss = ss << ss_scalar;
741 us = us << us2;
742 us = us << us_scalar;
743 bs = bs << bs2; // expected-error {{invalid operands}}
745 si = si << si2;
746 si = si << si_scalar;
747 ui = ui << ui2;
748 ui = ui << ui_scalar;
749 bi = bi << bi2; // expected-error {{invalid operands}}
751 sl = sl << sl2;
752 sl = sl << sl_scalar;
753 ul = ul << ul2;
754 ul = ul << ul_scalar;
755 bl = bl << bl2; // expected-error {{invalid operands}}
757 fd = fd << fd2; // expected-error {{integer is required}}
758 fd = fd << ul2; // expected-error {{integer is required}}
759 fd = sl << fd2; // expected-error {{integer is required}}
761 sc <<= sc2;
762 sc <<= uc2;
763 sc <<= bc2; // expected-error {{invalid operands}}
764 sc <<= sc_scalar;
766 uc <<= uc2;
767 uc <<= sc2;
768 uc <<= bc2; // expected-error {{invalid operands}}
769 uc <<= uc_scalar;
771 bc <<= bc2; // expected-error {{invalid operands}}
772 bc <<= sc2; // expected-error {{invalid operands}}
773 bc <<= uc2; // expected-error {{invalid operands}}
775 sc <<= ss2; // expected-error {{vector operands do not have the same number of elements}}
776 sc <<= si2; // expected-error {{vector operands do not have the same number of elements}}
777 sc <<= sl2; // expected-error {{vector operands do not have the same number of elements}}
778 sc <<= fd2; // expected-error {{integer is required}}
780 ss <<= ss2;
781 ss <<= ss_scalar;
782 us <<= us2;
783 us <<= us_scalar;
784 bs <<= bs2; // expected-error {{invalid operands}}
786 si <<= si2;
787 si <<= si_scalar;
788 ui <<= ui2;
789 ui <<= ui_scalar;
790 bi <<= bi2; // expected-error {{invalid operands}}
792 sl <<= sl2;
793 sl <<= sl_scalar;
794 ul <<= ul2;
795 ul <<= ul_scalar;
796 bl <<= bl2; // expected-error {{invalid operands}}
798 fd <<= fd2; // expected-error {{integer is required}}
800 // -------------------------------------------------------------------------
801 // Test >>.
802 // -------------------------------------------------------------------------
804 sc = sc >> sc2;
805 sc = sc >> uc2;
806 sc = uc >> sc2; // expected-error {{incompatible type}}
807 sc = sc >> bc2; // expected-error {{invalid operands}}
808 sc = bc >> sc2; // expected-error {{invalid operands}}
810 uc = uc >> uc2;
811 uc = sc >> uc2; // expected-error {{assigning to}}
812 uc = uc >> sc2;
813 uc = bc >> uc2; // expected-error {{invalid operands}}
814 uc = uc >> bc2; // expected-error {{invalid operands}}
816 bc = bc >> bc2; // expected-error {{invalid operands}}
817 bc = bc >> uc2; // expected-error {{invalid operands}}
818 bc = uc >> bc2; // expected-error {{invalid operands}}
819 bc = bc >> sc2; // expected-error {{invalid operands}}
820 bc = sc >> bc2; // expected-error {{invalid operands}}
822 sc = sc >> 1;
823 sc = sc >> 1.0f; // expected-error {{integer is required}}
824 sc = sc >> sc_scalar;
825 sc = sc >> uc_scalar;
826 sc = sc >> ss_scalar;
827 sc = sc >> us_scalar;
828 sc = sc >> si_scalar;
829 sc = sc >> ui_scalar;
830 sc = sc >> sl_scalar;
831 sc = sc >> ul_scalar;
832 sc = sc_scalar >> sc; // expected-error {{first operand is not a vector}}
833 sc = uc_scalar >> sc; // expected-error {{first operand is not a vector}}
834 uc = uc >> sc_scalar;
835 uc = uc >> uc_scalar;
836 uc = sc_scalar >> uc; // expected-error {{first operand is not a vector}}
837 uc = uc_scalar >> uc; // expected-error {{first operand is not a vector}}
839 ss = ss >> ss2;
840 ss = ss >> ss_scalar;
841 us = us >> us2;
842 us = us >> us_scalar;
843 bs = bs >> bs2; // expected-error {{invalid operands}}
845 si = si >> si2;
846 si = si >> si_scalar;
847 ui = ui >> ui2;
848 ui = ui >> ui_scalar;
849 bi = bi >> bi2; // expected-error {{invalid operands}}
851 sl = sl >> sl2;
852 sl = sl >> sl_scalar;
853 ul = ul >> ul2;
854 ul = ul >> ul_scalar;
855 bl = bl >> bl2; // expected-error {{invalid operands}}
857 fd = fd >> fd2; // expected-error {{integer is required}}
858 fd = fd >> ul2; // expected-error {{integer is required}}
859 fd = sl >> fd2; // expected-error {{integer is required}}
861 sc >>= sc2;
862 sc >>= uc2;
863 sc >>= bc2; // expected-error {{invalid operands}}
864 sc >>= sc_scalar;
866 uc >>= uc2;
867 uc >>= sc2;
868 uc >>= bc2; // expected-error {{invalid operands}}
869 uc >>= uc_scalar;
871 bc >>= bc2; // expected-error {{invalid operands}}
872 bc >>= sc2; // expected-error {{invalid operands}}
873 bc >>= uc2; // expected-error {{invalid operands}}
875 sc >>= ss2; // expected-error {{vector operands do not have the same number of elements}}
876 sc >>= si2; // expected-error {{vector operands do not have the same number of elements}}
877 sc >>= sl2; // expected-error {{vector operands do not have the same number of elements}}
878 sc >>= fd2; // expected-error {{integer is required}}
880 ss >>= ss2;
881 ss >>= ss_scalar;
882 us >>= us2;
883 us >>= us_scalar;
884 bs >>= bs2; // expected-error {{invalid operands}}
886 si >>= si2;
887 si >>= si_scalar;
888 ui >>= ui2;
889 ui >>= ui_scalar;
890 bi >>= bi2; // expected-error {{invalid operands}}
892 sl >>= sl2;
893 sl >>= sl_scalar;
894 ul >>= ul2;
895 ul >>= ul_scalar;
896 bl >>= bl2; // expected-error {{invalid operands}}
898 fd >>= fd2; // expected-error {{integer is required}}
900 // -------------------------------------------------------------------------
901 // Test ==.
902 // -------------------------------------------------------------------------
904 (void)(sc == sc2);
905 (void)(uc == uc2);
906 (void)(bc == bc2);
908 (void)(sc == uc); // expected-error {{cannot convert}}
909 (void)(sc == bc);
911 (void)(uc == sc); // expected-error {{cannot convert}}
912 (void)(uc == bc);
914 (void)(bc == sc);
915 (void)(bc == uc);
917 (void)(ss == ss2);
918 (void)(us == us2);
919 (void)(bs == bs2);
921 (void)(si == si2);
922 (void)(ui == ui2);
923 (void)(bi == bi2);
925 (void)(sl == sl2);
926 (void)(ul == ul2);
927 (void)(bl == bl2);
928 (void)(fd == fd2);
930 (void)(fd == ul); // expected-error {{cannot convert}}
931 (void)(ul == fd); // expected-error {{cannot convert}}
933 // -------------------------------------------------------------------------
934 // Test that == rules apply to != too.
935 // -------------------------------------------------------------------------
937 (void)(sc != sc2);
938 (void)(uc != uc2);
939 (void)(bc != bc2);
941 (void)(sc != uc); // expected-error {{cannot convert}}
942 (void)(sc != bc);
944 (void)(ss != ss2);
945 (void)(us != us2);
946 (void)(bs != bs2);
948 (void)(si != si2);
949 (void)(ui != ui2);
950 (void)(bi != bi2);
952 (void)(sl != sl2);
953 (void)(ul != ul2);
954 (void)(bl != bl2);
955 (void)(fd != fd2);
957 // -------------------------------------------------------------------------
958 // Test that == rules apply to <= too.
959 // -------------------------------------------------------------------------
961 (void)(sc <= sc2);
962 (void)(uc <= uc2);
963 (void)(bc <= bc2);
965 (void)(sc <= uc); // expected-error {{cannot convert}}
966 (void)(sc <= bc);
968 (void)(ss <= ss2);
969 (void)(us <= us2);
970 (void)(bs <= bs2);
972 (void)(si <= si2);
973 (void)(ui <= ui2);
974 (void)(bi <= bi2);
976 (void)(sl <= sl2);
977 (void)(ul <= ul2);
978 (void)(bl <= bl2);
979 (void)(fd <= fd2);
981 // -------------------------------------------------------------------------
982 // Test that == rules apply to >= too.
983 // -------------------------------------------------------------------------
985 (void)(sc >= sc2);
986 (void)(uc >= uc2);
987 (void)(bc >= bc2);
989 (void)(sc >= uc); // expected-error {{cannot convert}}
990 (void)(sc >= bc);
992 (void)(ss >= ss2);
993 (void)(us >= us2);
994 (void)(bs >= bs2);
996 (void)(si >= si2);
997 (void)(ui >= ui2);
998 (void)(bi >= bi2);
1000 (void)(sl >= sl2);
1001 (void)(ul >= ul2);
1002 (void)(bl >= bl2);
1003 (void)(fd >= fd2);
1005 // -------------------------------------------------------------------------
1006 // Test that == rules apply to < too.
1007 // -------------------------------------------------------------------------
1009 (void)(sc < sc2);
1010 (void)(uc < uc2);
1011 (void)(bc < bc2);
1013 (void)(sc < uc); // expected-error {{cannot convert}}
1014 (void)(sc < bc);
1016 (void)(ss < ss2);
1017 (void)(us < us2);
1018 (void)(bs < bs2);
1020 (void)(si < si2);
1021 (void)(ui < ui2);
1022 (void)(bi < bi2);
1024 (void)(sl < sl2);
1025 (void)(ul < ul2);
1026 (void)(bl < bl2);
1027 (void)(fd < fd2);
1029 // -------------------------------------------------------------------------
1030 // Test that == rules apply to > too.
1031 // -------------------------------------------------------------------------
1033 (void)(sc > sc2);
1034 (void)(uc > uc2);
1035 (void)(bc > bc2);
1037 (void)(sc > uc); // expected-error {{cannot convert}}
1038 (void)(sc > bc);
1040 (void)(ss > ss2);
1041 (void)(us > us2);
1042 (void)(bs > bs2);
1044 (void)(si > si2);
1045 (void)(ui > ui2);
1046 (void)(bi > bi2);
1048 (void)(sl > sl2);
1049 (void)(ul > ul2);
1050 (void)(bl > bl2);
1051 (void)(fd > fd2);