summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20011109-1.c
blob: 89e43272cadc5980345bcb5210900e41fb581987 (plain) (blame)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
   20011109-1.c from the execute part of the gcc torture tests.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

void fail1(void)
{
  ASSERT (0);
}
void fail2(void)
{
  ASSERT (0);
}
void fail3(void)
{
  ASSERT (0);
}
void fail4(void)
{
  ASSERT (0);
}


void foo(long x)
{
  switch (x)
    {
    case -6: 
      fail1 (); break;
    case 0: 
      fail2 (); break;
    case 1: case 2: 
      break;
    case 3: case 4: case 5: 
      fail3 ();
      break;
    default:
      fail4 ();
      break;
    }
  switch (x)
    {
      
    case -3: 
      fail1 (); break;
    case 0: case 4: 
      fail2 (); break;
    case 1: case 3: 
      break;
    case 2: case 8: 
      ASSERT (0);
      break;
    default:
      fail4 ();
      break;
    }
}

void
testTortureExecute (void)
{
  foo (1);
  return;
}