2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / ubsan / div-by-zero-1.C
blob11ed7ec08930caa4c625725d9abefa0f032dfb21
1 /* { dg-do compile } */
2 /* { dg-options "-fsanitize=integer-divide-by-zero" } */
4 void
5 foo (int i)
7   switch (i)
8   case 0 * (1 / 0): /* { dg-warning "division by zero" } */
9     ;  /* { dg-error "is not a constant.expression" "" { target *-*-* } .-1 } */