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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14)

/* PR rtl-optimization/45912 */

static void*
get_addr_base_and_unit_offset (void *base, long long *i)
{
  *i = 0;
  return base;
}

static void*
build_int_cst (void *base, long long offset)
{
  if (offset != 4)
    ASSERT (0);

  return base;
}

static void*
build_ref_for_offset (void *base, long long offset)
{
  long long base_offset;
  base = get_addr_base_and_unit_offset (base, &base_offset);
  return build_int_cst (base, base_offset + offset / 8);
}
#endif

void
testTortureExecute (void)
{
#if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14)
  void *ret = build_ref_for_offset ((void *)0, 32);
  if (ret != (void *)0)
    ASSERT (0);
  return;
#endif
}