aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr64906.c
blob: e0ac0eefd5e45875ef5d3936bf7346fdd6c05d65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* PR sanitizer/64906 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=integer-divide-by-zero -O -Werror=maybe-uninitialized" } */

int
fn1 (int f, int s)
{
  int ret = 0;
  if (f)
    ret = s / (f ? (unsigned long) 8 : 0);
  return ret;
}