Skip to content

Commit a7d242b

Browse files
committed
add more test
1 parent e02f443 commit a7d242b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/test/Sema/constant_builtins_vector.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ typedef double vector4double __attribute__((__vector_size__(32)));
1919
typedef float vector4float __attribute__((__vector_size__(16)));
2020
typedef long long vector4long __attribute__((__vector_size__(32)));
2121
typedef int vector4int __attribute__((__vector_size__(16)));
22+
typedef unsigned long long vector4ulong __attribute__((__vector_size__(32)));
23+
typedef unsigned int vector4uint __attribute__((__vector_size__(16)));
2224
typedef short vector4short __attribute__((__vector_size__(8)));
2325
typedef char vector4char __attribute__((__vector_size__(4)));
2426
typedef BitInt8 vector4BitInt8 __attribute__((__vector_size__(4)));
@@ -741,3 +743,5 @@ constexpr int reduceAddInt2 = __builtin_reduce_add((vector4int){(1 << 31), 0, 0,
741743
constexpr long long reduceAddLong2 = __builtin_reduce_add((vector4long){(1LL << 63), 0, 0, -1});
742744
// expected-error@-1 {{must be initialized by a constant expression}} \
743745
// expected-note@-1 {{outside the range of representable values of type 'long long'}}
746+
static_assert(__builtin_reduce_add((vector4uint){~0U, 0, 0, 1}) == 0);
747+
static_assert(__builtin_reduce_add((vector4ulong){~0ULL, 0, 0, 1}) == 0);

0 commit comments

Comments
 (0)