1 /* PR middle-end/101494 - bogus -Wmaybe-uninitialized on memrchr of size 0
3 { dg-options "-O2 -Wall" }
4 { dg-require-effective-target alloca } */
6 typedef __SIZE_TYPE__
size_t;
10 __attribute__ ((malloc
, alloc_size (1))) void* alloc (size_t);
12 __attribute__ ((access (read_only
, 1, 2))) void* sink (void*, size_t);
14 void test_alloca_zero (size_t i
)
17 sink (p
, 0); // { dg-bogus "\\\[-Wuninitialized" }
20 void test_alloca_zero_pi (size_t i
)
26 void test_alloca_cst (void)
29 sink (p
, 0); // { dg-bogus "\\\[-Wuninitialized" }
32 void test_alloca_cst_p1 (void)
35 sink (p
+ 1, 0); // { dg-bogus "\\\[-Wuninitialized" }
38 void test_alloca_cst_p7 (void)
41 sink (p
+ 7, 0); // { dg-bogus "\\\[-Wuninitialized" }
44 void test_alloca_var (size_t n
)
47 sink (p
, 0); // { dg-bogus "\\\[-Wuninitialized" }
50 void test_alloca_var_p1 (size_t n
)
53 sink (p
+ 1, 0); // { dg-bogus "\\\[-Wuninitialized" }
56 void test_alloca_var_pn (size_t n
)
59 sink (p
+ n
, 0); // { dg-bogus "\\\[-Wuninitialized" }