struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20140212-2.c
blob36d4c1903e4ce3626d3553f7435f9bd90bcceabf
1 /*
2 20140212-2.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 /* This used to fail as we would convert f into just return (unsigned int)usVlanID
12 which is wrong. */
14 int f(unsigned short usVlanID);
15 int f(unsigned short usVlanID)
17 unsigned int uiVlanID = 0xffffffff;
18 if ((unsigned short)0xffff != usVlanID)
19 uiVlanID = (unsigned int)usVlanID;
20 return uiVlanID;
23 void
24 testTortureExecute (void)
26 ASSERT (f(1) == 1);
27 ASSERT (f(0xffff) == -1);