]> git.sur5r.net Git - cc65/blob - test/val/switch2.c
goto.c warning fix for implicit truncation
[cc65] / test / val / switch2.c
1 /*
2   !!DESCRIPTION!! Testing empty bodied switch statements.
3   !!ORIGIN!!      
4   !!LICENCE!!     GPL, read COPYING.GPL
5 */
6
7 #include <stdio.h>
8
9 unsigned char success=0;
10 unsigned char failures=0;
11 unsigned char dummy=0;
12
13 void done()
14 {
15   dummy++;
16 }
17
18 void switch_no_body(void)
19 {
20   switch(0);
21 }
22
23 void switch_empty_body(void)
24 {
25   switch(0) {}
26 }
27
28 /* only worried about this file compiling successfully */
29 int main(void)
30 {
31   switch_no_body();
32   switch_empty_body();
33
34   success=failures;
35   done();
36   printf("failures: %d\n",failures);
37
38   return failures;
39 }