1 /* { dg-do compile } */
2 /* { dg-options "-Wall -O3 -fdump-tree-vrp2" } */
6 void foo(std::vector<unsigned int> &v);
10 std::vector<unsigned int> v;
13 v.resize (v.size()-1);
17 /* As written this testcase should trigger a warning. We overflow to -1U
18 if v.size() == 0 in foo(). This results in bogus calls to memset.
20 The number of clearing loops in the IL can vary depending on the C++
21 mode used for the test. But by the end of VRP2, there should be a single
22 clearing loop left and it should be using memcpy. */
23 /* { dg-final { scan-tree-dump-times "__builtin_memset \\(_\[0-9\]+, 0, \[0-9\]+\\)" 1 "vrp2" } } */
25 /* And that call should trigger a warning. */
26 /* { dg-warning "exceeds maximum object size" "" { target *-*-* } 0 } */