aboutsummaryrefslogtreecommitdiff
path: root/compiler/tests/parser/statement_switch.good
blob: 1e0d6545992f3dbb30cfb1ce6b09675396119371 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37

int test()
{
    int i = 1;
    
    switch i {
        case 1 {
            dostuff(1);
        }
    }
    
    switch i {
        case 1 {
            dostuff(1);
        }
        case 2
        case 3 {
            dostuff(23);
        }
        default {
            dostuff(9);
        }
    }
    
    bool b = :true;
    switch b {
        case :false return 99;
        case :true return 100;
    }
    
    switch b { } // empty switch statement is allowed
    switch b {
        default { }
    }
}

() dostuff(int x) { }