Mercurial > projects > dstress
annotate run/c/case_05_C.d @ 1320:daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author | thomask |
---|---|
date | Sun, 31 Dec 2006 19:59:08 +0000 |
parents | 0972a593ff76 |
children |
rev | line source |
---|---|
1240
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
2 // $Date$ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
3 // $Author$ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
4 |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
5 // @author@ Nazo Humei <lovesyao@hotmail.com> |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
6 // @date@ 2006-11-25 |
1320
daef239f37cf
sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents:
1240
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=596 |
1240
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
8 // @desc@ [Issue 596] New: Support array, arrayliteral and struct in switch and case |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
9 |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
10 module dstress.run.c.case_05_C; |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
11 |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
12 int test(wchar[] s){ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
13 switch(s){ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
14 case [cast(wchar)'a', '2']: |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
15 return 1; |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
16 case [cast(wchar)'b']: |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
17 return 3; |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
18 default: |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
19 return 4; |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
20 } |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
21 } |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
22 |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
23 int main(){ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
24 if(test("b") != 3){ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
25 assert(0); |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
26 } |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
27 if(test("a2") != 1){ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
28 assert(0); |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
29 } |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
30 if(test("abcd") != 4){ |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
31 assert(0); |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
32 } |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
33 |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
34 return 0; |
0972a593ff76
[Issue 596] New: Support array, arrayliteral and struct in switch and case
thomask
parents:
diff
changeset
|
35 } |