2 * File name: test/Switcher.c
3 * Purpose: test the switch statement
4 * Author: Boris Boesler
5 * Modified by: Michael Beck
8 * Copyright: (c) 2003 Universitaet Karlsruhe
14 static void print_int(int i) {
18 // standard switch with 1 case
19 static void switch1(int i) {
30 // standard switch with more than 1 case
31 static void switch2(int i) {
45 // standard switch with fall through
46 static void switch3(int i) {
60 // standard switch without default
61 static void switch4(int i) {
72 // standard switch without case
73 static void switch5(int i) {
81 // standard switch with more than 1 case and controlflow change
82 static void switch6(int i) {
99 // standard switch with more than 1 case label
100 static void switch7(int i) {
116 static void double_switch(int i) {
123 printf(" multiple of 4\n");
126 printf(" not multiple of 4\n");
132 printf(" != 10 und != 16\n");
138 int main (int argc, char *argv[]) {
139 printf("Switcher.c\n");
140 printf(" must print:\n 0\n 2\n 0\n 3\n -1\n 2\n 5\n is 16\n multiple of 4\n\n");