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

#include <testfwk.h>

/* See http://gcc.gnu.org/ml/gcc/2009-06/msg00072.html.  */

#if 0 // Enable when SDCC supports bit-fields wider than 16 bits

struct s
{
  unsigned long long a:2;
  unsigned long long b:40;
  unsigned long long c:22;
};

void
g (unsigned long long a, unsigned long long b)
{
#ifdef __SDCC
  __asm;
  __endasm;
#endif
  if (a != b)
    ASSERT (0);
}

void
f (struct s s, unsigned long long b)
{
#ifdef __SDCC
  __asm;
  __endasm;
#endif
  g (((unsigned long long) (s.b-8)) + 8, b);
}
#endif

void
testTortureExecute (void)
{
#if 0 // Enable when SDCC supports bit-fields wider than 16 bits
  struct s s = {1, 10, 3};
  struct s t = {1, 2, 3};
  f (s, 10);
  f (t, 0x10000000002);
#endif
  return;
}