annotate test/switch3.d @ 131:5825d48b27d1 trunk

[svn r135] * Merged DMD 1.025 * * Fixed a minor linking order mishap * * Added an command line option -annotate * * Fixed some problems with running optimizations * * Added std.stdio and dependencies to lphobos (still not 100% working, but compiles and links) * * Fixed problems with passing aggregate types to variadic functions * * Added initial code towards full GC support, currently based on malloc and friends, not all the runtime calls the GC yet for memory * * Fixed problems with resolving nested function context pointers for some heavily nested cases * * Redid function argument passing + other minor code cleanups, still lots to do on this end... *
author lindquist
date Fri, 04 Jan 2008 01:38:42 +0100
parents 36ab367572df
children d9d5d59873d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
122
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
1 module switch3;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
2
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
3 void main()
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
4 {
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
5 char[] str = "hello";
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
6 int i;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
7 switch(str)
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
8 {
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
9 case "world":
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
10 i = 1;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
11 assert(0);
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
12 case "hello":
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
13 i = 2;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
14 break;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
15 case "a","b","c":
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
16 i = 3;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
17 assert(0);
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
18 default:
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
19 i = 4;
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
20 assert(0);
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
21 }
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
22 assert(i == 2);
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
23 printf("SUCCESS\n");
36ab367572df [svn r126] String switch is now implemented.
lindquist
parents:
diff changeset
24 }