Fix all tests that fail with -sanitize=return.
[official-gcc.git] / gcc / testsuite / g++.dg / tree-ssa / pr29902.C
blob996a3b9b53d9e31519bf663823e594057912918b
1 /* { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
2 /* { dg-options "-O1 -fprefetch-loop-arrays -march=athlon" } */
4 int length1();
5 int g(int);
6 void f(int capacity_, char *old_storage)
8   try {
9       length1();
10       int old_capacity = capacity_;
11       capacity_ *= 2;
12       g(capacity_);
13       for (int i = 1; i < old_capacity; i++)
14         old_storage[i] = old_storage[i - 1];
15   } catch (...) {
16       for (int i = 1; i < capacity_; i++){old_storage[i] = 0;}
17   }