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

#include <testfwk.h>

#include <stdint.h>

typedef uint8_t u8;
typedef uint32_t u32;

#if !defined(__SDCC_pdk14) // Lack of memory
u32 a, b, d, e;
u8 c;

static u32
foo (u32 p)
{
  do
    {
      e /= 0xfff;
      if (p > c)
	d = 0;
      e -= 3;
      e *= b <= a;
    }
  while (e >= 88030);
  return e;
}
#endif

void
testTortureExecute (void)
{
#if !defined(__SDCC_pdk14) // Lack of memory
  u32 x = foo (1164);
  if (x != 0xfd)
    ASSERT (0);
  return;
#endif
}