blob: d0e5beed010ca71da849d644ee87adc2377d84bf [file] [log] [blame]
/* { dg-additional-options "-std=gnu89" } */
f (b, c)
unsigned char *b;
int c;
{
unsigned long v = 0;
switch (c)
{
case 'd':
v = ((unsigned long)b[0] << 8) + b[1];
v >>= 9;
break;
case 'k':
v = b[3] >> 4;
break;
default:
abort ();
}
return v;
}
main ()
{
char buf[4];
buf[0] = 170; buf[1] = 5;
if (f (buf, 'd') != 85)
abort ();
exit (0);
}