2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / pr71512.C
blob9822c989a1cf92d2d8ab49f8bcd8055bcc6a0d9b
1 /* PR c/71512 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftrapv -fnon-call-exceptions -fsanitize=undefined" } */
5 bool
6 foo (int *x, int *y, int *z)
8   try
9     {
10       x[0] = y[0] + z[0];
11       x[1] = y[1] - z[1];
12       x[2] = y[2] * z[2];
13       x[3] = -y[3];
14     }
15   catch (...)
16     {
17       return true;
18     }
19   return false;