view gcc/testsuite/c-c++-common/ubsan/pr63879-1.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR sanitizer/63879 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined" } */

struct A
{
  int inode;
} * a;
int b, c;
void
fn1 ()
{
  int d = 0;
  while (b)
    {
      if (a->inode)
        d++;
      a = 0;
    }
  c = d - 1;
  for (; c >= 0; c--)
    ;
}