1 /*
2    20140212-2.c from the execute part of the gcc torture suite.
3  */
4 
5 #include <testfwk.h>
6 
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
10 
11 /* This used to fail as we would convert f into just return (unsigned int)usVlanID
12    which is wrong. */
13 
14 int f(unsigned short usVlanID);
f(unsigned short usVlanID)15 int f(unsigned short usVlanID)
16 {
17   unsigned int uiVlanID = 0xffffffff;
18   if ((unsigned short)0xffff != usVlanID)
19     uiVlanID = (unsigned int)usVlanID;
20   return uiVlanID;
21 }
22 
23 void
testTortureExecute(void)24 testTortureExecute (void)
25 {
26   ASSERT (f(1) == 1);
27   ASSERT (f(0xffff) == -1);
28 }
29