summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gdc.test/fail_compilation/fail34.d
blob: f910a2d167a1f2c172e06115aceedb3c9a95de1e (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
38
39
40
41
42
/*
TEST_OUTPUT:
---
fail_compilation/fail34.d(31): Error: duplicate `case "123"` in switch statement
---
*/

// $HeadURL$
// $Date$
// $Author$

// @author@	Thomas Kuehne <thomas-dloop@kuehne.thisisspam.cn>
// @date@	2004-11-17
// @uri@	news:u1gr62-kjv.ln1@kuehne.cn
// @url@	nntp://digitalmars.com/digitalmars.D.bugs/2288

// duplicate case "123" in switch statement

module switch_12;

int main()
{
    string array = "123";
    switch(array)
    {
        case "123":
        {
            assert(0);
            break;
        }
        case "123":
        {
            assert(1);
            break;
        }
        default:
        {
            return -1; // dummy
        }
    }
    return 0;
}