1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 21:32:19 +00:00

Now testing switch statements with empty bodies.

This commit is contained in:
Chris Cacciatore 2016-08-15 11:36:50 -07:00
parent c4823c6fd4
commit ac4bdbd411

39
test/val/switch2.c Normal file
View File

@ -0,0 +1,39 @@
/*
!!DESCRIPTION!! Testing empty bodied switch statements.
!!ORIGIN!!
!!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)
{
switch(0) {};
}
/* 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;
}