struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-pr88693.c
blobc32db9c6102cc4cfdd7d5eb48386444ad293ca69
1 /*
2 pr88693.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #include <string.h>
9 /* PR tree-optimization/88693 */
11 void
12 foo (char *p)
14 if (strlen (p) != 9)
15 ASSERT (0);
18 void
19 quux (char *p)
21 int i;
22 for (i = 0; i < 100; i++)
23 if (p[i] != 'x')
24 ASSERT (0);
27 void
28 qux (void)
30 #if !(defined(__SDCC_pdk14) || defined(__SDCC_pdk15) && !defined(__SDCC_STACK_AUTO) || defined(__SDCC_mcs51)) // Lack of memory
31 char b[100];
32 memset (b, 'x', sizeof (b));
33 quux (b);
34 #endif
37 void
38 bar (void)
40 #if !(defined(__SDCC_pdk14) || defined(__SDCC_pdk15) && !defined(__SDCC_STACK_AUTO) || defined(__SDCC_mcs51)) // Lack of memory
41 static unsigned char u[9] = "abcdefghi";
42 char b[100];
43 memcpy (b, u, sizeof (u));
44 b[sizeof (u)] = 0;
45 foo (b);
46 #endif
49 void
50 baz (void)
52 #if !(defined(__SDCC_pdk14) || defined(__SDCC_pdk15) && !defined(__SDCC_STACK_AUTO) || defined(__SDCC_mcs51)) // Lack of memory
53 static unsigned char u[] = { 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r' };
54 char b[100];
55 memcpy (b, u, sizeof (u));
56 b[sizeof (u)] = 0;
57 foo (b);
58 #endif
61 void
62 testTortureExecute (void)
64 qux ();
65 bar ();
66 baz ();
67 return;