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 static int id(int i) {
22 // standard switch with 1 case
23 static void switch1(int i) {
34 // standard switch with more than 1 case
35 static void switch2(int i) {
49 // standard switch with fall through
50 static void switch3(int i) {
64 // standard switch without default
65 static void switch4(int i) {
76 // standard switch without case
77 static void switch5(int i) {
85 // standard switch with more than 1 case and controlflow change
86 static void switch6(int i) {
103 // standard switch with more than 1 case label
104 static void switch7(int i) {
120 static void double_switch(int i) {
127 printf(" multiple of 4\n");
130 printf(" not multiple of 4\n");
136 printf(" != 10 und != 16\n");
142 int main (int argc, char *argv[]) {
143 printf("Switcher.c\n");
144 printf(" must print:\n 0\n 2\n 0\n 3\n -1\n 2\n is 16\n multiple of 4\n\n");