summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/pr64121.c
blob: 614d72a22afd88d1256d2f499dc52b06a6c2b371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* PR sanitizer/64121 */
/* { dg-do compile } */
/* { dg-options "-fsanitize=undefined -Wno-pointer-arith" } */

extern int tab[16];

void
execute (int *ip, int x)
{
  int *xp = tab;
base:
  if (x)
    return;
  *xp++ = *ip;
  goto *(&&base + *ip);
}