1 /*
2    20170111-1.c from the execute part of the gcc torture suite.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
10 
11 /* PR rtl-optimization/79032 */
12 /* Reported by Daniel Cederman <cederman@gaisler.com> */
13 
14 #ifndef __SDCC_pdk14 // Lack of memory
15 struct S {
16   short a;
17   long long b;
18   short c;
19   char d;
20   unsigned short e;
21   long *f;
22 };
23 
24 static long foo (struct S *s);
25 
foo(struct S * s)26 static long foo (struct S *s)
27 {
28   long a = 1;
29   a /= s->e;
30   s->f[a]--;
31   return a;
32 }
33 #endif
34 
35 void
testTortureExecute(void)36 testTortureExecute (void)
37 {
38 #ifndef __SDCC_pdk14 // Lack of memory
39   long val = 1;
40   struct S s = { 0, 0, 0, 0, 2, &val };
41   val = foo (&s);
42   if (val != 0)
43     ASSERT (0);
44 #endif
45 }
46