aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asan/pr66314.c
blob: 956e5d34faea7bf9666c0ecfef750a0f32cc1a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* { dg-do compile } */
/* { dg-options "-std=gnu89 -fprofile-arcs -fno-sanitize=all -fsanitize=kernel-address" } */
/* { dg-skip-if "" { *-*-* }  { "*" } { "-Os" } } */

char *a;
int d;

static int
fn1 (int b, int c)
{
  while (a)
    if (*a)
      return -126;
  if (b)
    return -12;
  if (c == -12)
    return c;
}

void
fn2 (int b, int c)
{
  for (;;)
    {
      d = fn1 (b, c);
      switch (d)
        {
        case -126:
          continue;
        default:
          return;
        }
    }
}