From: Chris Cacciatore Date: Mon, 15 Aug 2016 18:36:50 +0000 (-0700) Subject: Now testing switch statements with empty bodies. X-Git-Tag: V2.16~79^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ac4bdbd411af5cafe1062693816b806f51f3b6e7;p=cc65 Now testing switch statements with empty bodies. --- diff --git a/test/val/switch2.c b/test/val/switch2.c new file mode 100644 index 000000000..00206b0f6 --- /dev/null +++ b/test/val/switch2.c @@ -0,0 +1,39 @@ +/* + !!DESCRIPTION!! Testing empty bodied switch statements. + !!ORIGIN!! + !!LICENCE!! GPL, read COPYING.GPL +*/ + +#include + +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; +}