2016-08-15 18:36:50 +00:00
|
|
|
/*
|
|
|
|
!!DESCRIPTION!! Testing empty bodied switch statements.
|
2022-04-17 14:07:52 +00:00
|
|
|
!!ORIGIN!!
|
2016-08-15 18:36:50 +00:00
|
|
|
!!LICENCE!! GPL, read COPYING.GPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
unsigned char success=0;
|
|
|
|
unsigned char failures=0;
|
|
|
|
unsigned char dummy=0;
|
|
|
|
|
|
|
|
void done()
|
|
|
|
{
|
|
|
|
dummy++;
|
|
|
|
}
|
|
|
|
|
|
|
|
void switch_no_body(void)
|
|
|
|
{
|
|
|
|
switch(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void switch_empty_body(void)
|
|
|
|
{
|
2016-08-20 03:21:10 +00:00
|
|
|
switch(0) {}
|
2016-08-15 18:36:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* only worried about this file compiling successfully */
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
switch_no_body();
|
|
|
|
switch_empty_body();
|
|
|
|
|
|
|
|
success=failures;
|
|
|
|
done();
|
|
|
|
printf("failures: %d\n",failures);
|
|
|
|
|
|
|
|
return failures;
|
|
|
|
}
|