@@ -765,3 +765,15 @@ constexpr long long reduceMulLong2 = __builtin_reduce_mul((vector4long){(1LL <<
765765// expected-note@-1 {{outside the range of representable values of type 'long long'}}
766766static_assert (__builtin_reduce_mul((vector4uint){~0U , 1 , 1 , 2 }) == ~0U - 1 );
767767static_assert (__builtin_reduce_mul((vector4ulong){~0ULL , 1 , 1 , 2 }) == ~0ULL - 1 );
768+
769+ static_assert (__builtin_reduce_and((vector4char){}) == 0 );
770+ static_assert (__builtin_reduce_and((vector4char){(char )0x11 , (char )0x22 , (char )0x44 , (char )0x88 }) == 0 );
771+ static_assert (__builtin_reduce_and((vector4short){(short )0x1111 , (short )0x2222 , (short )0x4444 , (short )0x8888 }) == 0 );
772+ static_assert (__builtin_reduce_and((vector4int){(int )0x11111111 , (int )0x22222222 , (int )0x44444444 , (int )0x88888888 }) == 0 );
773+ static_assert (__builtin_reduce_and((vector4long){(long long )0x1111111111111111L , (long long )0x2222222222222222L , (long long )0x4444444444444444L , (long long )0x8888888888888888L }) == 0L );
774+ static_assert (__builtin_reduce_and((vector4char){(char )-1 , (char )~0x22 , (char )~0x44 , (char )~0x88 }) == 0x11 );
775+ static_assert (__builtin_reduce_and((vector4short){(short )~0x1111 , (short )-1 , (short )~0x4444 , (short )~0x8888 }) == 0x2222 );
776+ static_assert (__builtin_reduce_and((vector4int){(int )~0x11111111 , (int )~0x22222222 , (int )-1 , (int )~0x88888888 }) == 0x44444444 );
777+ static_assert (__builtin_reduce_and((vector4long){(long long )~0x1111111111111111L , (long long )~0x2222222222222222L , (long long )~0x4444444444444444L , (long long )-1 }) == 0x8888888888888888L );
778+ static_assert (__builtin_reduce_and((vector4uint){0x11111111U , 0x22222222U , 0x44444444U , 0x88888888U }) == 0U );
779+ static_assert (__builtin_reduce_and((vector4ulong){0x1111111111111111UL , 0x2222222222222222UL , 0x4444444444444444UL , 0x8888888888888888UL }) == 0L );
0 commit comments