Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr70566.c
blobf9ea89d90235082cc76c873ff3f2aeb15716b656
1 /*
2 pr70566.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #pragma disable_warning 85
13 /* PR target/70566. */
15 #define NULL 0
17 struct mystruct
19 unsigned int f1 : 1;
20 unsigned int f2 : 1;
21 unsigned int f3 : 1;
24 void
25 myfunc (int a, void *b)
28 int
29 myfunc2 (void *a)
31 return 0;
34 static void
35 set_f2 (struct mystruct *user, int f2)
37 if (user->f2 != f2)
38 myfunc (myfunc2 (NULL), NULL);
39 else
40 ASSERT (0);
43 void
44 foo (void *data)
46 struct mystruct *user = data;
47 if (!user->f2)
48 set_f2 (user, 1);
51 void
52 testTortureExecute (void)
54 struct mystruct a;
55 a.f1 = 1;
56 a.f2 = 0;
57 foo (&a);
58 return;