annotate run/InExpression_04.d @ 1576:b3e16c86558e

[Issue 1398] New: GDC doesn't generate correct code <mariusmuja@gmail.com> 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1398
author thomask
date Thu, 21 Feb 2008 15:20:08 +0000
parents da000f026b76
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
180
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
1 // $HeadURL$
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
2 // $Date$
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
3 // $Author$
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
4
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
5 module dstress.run.InExpression_04;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
6
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
7 struct MyStruct{
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
8 int i;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
9 char c;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
10 }
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
11
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
12 int main(){
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
13 MyStruct value;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
14 value.i = 1;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
15 value.c = '1';
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
16 char[] key = "eins";
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
17 MyStruct[char[]] array;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
18
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
19 array[key]=value;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
20 MyStruct* ptr = key in array;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
21
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
22 assert(value == *ptr);
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
23
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
24 return 0;
da000f026b76 1) added InExpression tests
thomask
parents:
diff changeset
25 }