blob: 3a5a133ab450dcb53eef7f8ba8b69cf7c24f000b (
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
51
52
53
|
/*
20171008-1.c from the execute part of the gcc torture tests.
*/
#include <testfwk.h>
#ifdef __SDCC
#pragma disable_warning 85
#endif
struct S { char c1, c2, c3, c4; };
static char bar (char **p);
static struct S foo (void);
int i;
static char
bar (char **p)
{
i = 1;
return 0;
}
#if 0 // Enable when SDCC can return struct
static struct S
foo (void)
{
struct S ret;
char r, s, c1, c2;
char *p = &r;
s = bar (&p);
if (s)
c2 = *p;
c1 = 0;
ret.c1 = c1;
ret.c2 = c2;
return ret;
}
#endif
void
testTortureExecute (void)
{
#if 0 // Enable when SDCC can return struct
struct S s = foo ();
if (s.c1 != 0)
ASSERT (0);
return;
#endif
}
|