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

#include <testfwk.h>

#ifdef __SDCC
#pragma std_c99
#endif

/* PR target/60017 */

struct S0
{
  short m0;
  short m1;
};

struct S1
{
  unsigned m0:1;
  char m1[2][2];
  struct S0 m2[2];
};

struct S1 x = { 1, {{2, 3}, {4, 5}}, {{6, 7}, {8, 9}} };

#if 0 // Enable when SDCC can return struct
struct S1 func (void)
{
  return x;
}
#endif

void
testTortureExecute (void)
{
#if 0
  struct S1 ret = func ();

  if (ret.m2[1].m1 != 9)
    ASSERT (0);
#endif
}