From ac4bdbd411af5cafe1062693816b806f51f3b6e7 Mon Sep 17 00:00:00 2001 From: Chris Cacciatore Date: Mon, 15 Aug 2016 11:36:50 -0700 Subject: [PATCH] Now testing switch statements with empty bodies. --- test/val/switch2.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 test/val/switch2.c 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; +} -- 2.39.5