mirror of
https://github.com/nArnoSNES/tcc-65816.git
synced 2024-05-31 22:41:28 +00:00
28 lines
383 B
C
28 lines
383 B
C
extern void exit (int);
|
|
extern void abort (void);
|
|
extern unsigned short f (short a) __attribute__((__noinline__));
|
|
|
|
unsigned short
|
|
f (short a)
|
|
{
|
|
short b;
|
|
|
|
if (a > 0)
|
|
return 0;
|
|
b = ((int) a) + - (int) 32768;
|
|
return b;
|
|
}
|
|
|
|
int
|
|
main (void)
|
|
{
|
|
if (sizeof (short) < 2
|
|
|| sizeof (short) >= sizeof (int))
|
|
exit (0);
|
|
|
|
if (f (-32767) != 1)
|
|
abort ();
|
|
|
|
exit (0);
|
|
}
|