aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/ubsan/div-by-zero-1.C
blob: 88acfa1517eb045a81bf472ccfd93ddbc176fffc (plain)
1
2
3
4
5
6
7
8
9
10
/* { dg-do compile } */
/* { dg-options "-fsanitize=integer-divide-by-zero -w" } */

void
foo (int i)
{
  switch (i)
  case 0 * (1 / 0): /* { dg-error "is not a constant expression" } */
    ;
}