1 /* PR middle-end/89797 - ICE on a vector_size (1LU << 33) int variable
2 PR c/89798 - excessive vector_size silently accepted and truncated
3 { dg-do compile { target int32plus } }
4 { dg-options "-Wall -Wno-unused" } */
6 #define ASSERT(e) _Static_assert (e, #e)
7 #define VEC(N) __attribute__ ((vector_size (N)))
8 #define POW2(N) (1LLU << N)
9 #define CAT(a, b) a ## b
10 #define CONCAT(a, b) CAT (a, b)
12 #define DEFVEC(storage, N) \
13 typedef VEC (POW2 (N)) char CONCAT (Vec, N); \
14 storage CONCAT (Vec, N) CONCAT (v, N); \
15 ASSERT (sizeof (CONCAT (Vec, N)) == POW2 (N)); \
16 ASSERT (sizeof (CONCAT (v, N)) == POW2 (N))
23 #if __SIZEOF_SIZE_T__ > 4
25 VEC (POW2 (63)) char v63
; /* { dg-error "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "not-ILP32" { target { ! ilp32 } } } */
29 VEC (POW2 (31)) char v31
; /* { dg-error "'vector_size' attribute argument value '2147483648' exceeds 2147483647" "ILP32" { target ilp32 } } */
31 VEC (POW2 (32)) char v32
; /* { dg-error "'vector_size' attribute argument value '4294967296' exceeds 2147483647" "ILP32" { target ilp32 } } */
35 void test_local_scope (void)
42 #if __SIZEOF_SIZE_T__ > 4
44 VEC (POW2 (63)) char v63
; /* { dg-error "'vector_size' attribute argument value '9223372036854775808' exceeds 9223372036854775807" "not-ILP32" { target { ! ilp32 } } } */
48 VEC (POW2 (31)) char v31
; /* { dg-error "'vector_size' attribute argument value '2147483648' exceeds 2147483647" "ILP32" { target ilp32 } } */
50 VEC (POW2 (32)) char v32
; /* { dg-error "'vector_size' attribute argument value '4294967296' exceeds 2147483647" "ILP32" { target ilp32 } } */