struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr68532.c
blob795469d7fd15b6ca2fbfe9fea7ce12c0e32ff9b9
1 /*
2 pr68532.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c11
9 #endif
11 /* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model" } */
12 /* { dg-additional-options "-fno-common" { target hppa*-*-hpux* } } */
14 #define SIZE 128
15 #if !(defined(__SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_pic14) // Array too big to fit in memory.
16 unsigned short _Alignas (/*16 - not supported in SDCC*/0) in[SIZE];
17 #endif
19 int
20 test (unsigned short sum, unsigned short *in, int x)
22 for (int j = 0; j < SIZE; j += 8)
23 sum += in[j] * x;
24 return sum;
27 void
28 testTortureExecute (void)
30 #if !(defined(__SDCC_mcs51) && (defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM))) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) && !defined(__SDCC_pic14)
31 for (int i = 0; i < SIZE; i++)
32 in[i] = i;
34 if (test (0, in, 1) != 960)
35 ASSERT (0);
36 #endif
37 return;