summaryrefslogtreecommitdiff
path: root/support/regression/tests/gcc-torture-execute-20070517-1.c
blob: 88cb0640648a5ced38f0d6b54855cc38bb138127 (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
/*
   20070517-1.c from the execute part of the gcc torture suite.
 */

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* PR rtl-optimization/31691 */
/* Origin: Chi-Hua Chen <stephaniechc-gccbug@yahoo.com> */

static int get_kind(int);

static int get_kind(int v)
{
  volatile int k = v;
  return k;
}

static int some_call(void);

static int some_call(void)
{
  return 0;
}

static void example (int arg)
{
  int tmp, kind = get_kind (arg);

  if (kind == 9 || kind == 10 || kind == 5)
    {
      if (some_call() == 0)
        {
          if (kind == 9 || kind == 10)
            tmp = arg;
          else
            ASSERT (0);
        }
    }
} 

void testTortureExecute(void)
{
  example(10);
  return;
}