summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr33676.c
blob: af65478a158bf345e264ccb4cd40157cd962ab6c (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* { dg-do run } */
/* { dg-options "-O0 -mtune=i386 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */

__attribute__((noreturn,noinline)) void abrt (const char *fi, const char *fu)
{
  __builtin_abort ();
}

__attribute__((noinline)) int f (int k)
{
  return k;
}

__attribute__((noinline)) int g (int t, int k)
{
  int b;

  switch (t)
    {
    case 0:
      abrt (__FILE__, __FUNCTION__);

    case 1:
      b = f (k);
      break;

    case 2:
      b = f (k);
      break;

    case 3:
      b = f (k);
      break;

    case 4:
      b = f (k);
      break;

    default:
      abrt (__FILE__, __FUNCTION__);
    }

  return b;
}

int main (void)
{
  if (g (3, 1337) != 1337)
      abrt (__FILE__, __FUNCTION__);
  return 0;
}