aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/b16967.d
blob: 7a2c3e4685fddbc38a38fe12177933f3e9a5e8b0 (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
/*
 * TEST_OUTPUT:
---
fail_compilation/b16967.d(15): Error: switch case fallthrough - use 'goto default;' if intended
fail_compilation/b16967.d(25): Error: switch case fallthrough - use 'goto default;' if intended
---
*/
int foo(int x)
in
{
    switch (x)
    {
        case 1:
            assert(x != 0);
        default:
            break;
    }
}
out(v)
{
    switch(v)
    {
        case 42:
            assert(x != 0);
        default:
            break;
    }
}
do
{
    return 42;
}