2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / 20020206-2.c
blob097eb3055c1fc01c63bb12a69aecd8728c835b79
1 /* Origin: PR c/5420 from David Mosberger <davidm@hpl.hp.com>.
2 This testcase was miscompiled when tail call optimizing, because a
3 compound literal initialization was emitted only in the tail call insn
4 chain, not in the normal call insn chain. */
6 typedef struct { unsigned short a; } A;
8 extern void abort (void);
9 extern void exit (int);
11 void foo (unsigned int x)
13 if (x != 0x800 && x != 0x810)
14 abort ();
17 int
18 main (int argc, char **argv)
20 int i;
21 for (i = 0; i < 2; ++i)
22 foo (((A) { ((!(i >> 4) ? 8 : 64 + (i >> 4)) << 8) + (i << 4) } ).a);
23 exit (0);