struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-961213-1.c
blob0b44fb628dc1989296487cce4494728e8ebb9542
1 /*
2 961213-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #if !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14)
12 int
13 g (unsigned long long int *v, int n, unsigned int a[], int b)
15 int cnt;
16 *v = 0;
17 for (cnt = 0; cnt < n; ++cnt)
18 *v = *v * b + a[cnt];
19 return n;
21 #endif
23 void
24 testTortureExecute (void)
26 #if !defined(__SDCC_mcs51) && !defined(__SDCC_pic14) && !defined(__SDCC_pic16) && !defined(__SDCC_pdk14) // Lack of memory
27 int res;
28 unsigned int ar[] = { 10, 11, 12, 13, 14 };
29 unsigned long long int v;
31 res = g (&v, sizeof(ar)/sizeof(ar[0]), ar, 16);
32 if (v != 0xabcdeUL)
33 ASSERT (0);
35 return;
36 #endif