annotate nocompile/offset_01.d @ 172:e5bbb877feb9

extended offsetof / offset tests
author thomask
date Wed, 01 Dec 2004 13:53:23 +0000
parents e2ba37f5b797
children f87ba6507260
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
171
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
1 // $HeadURL$
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
2 // $Date$
172
e5bbb877feb9 extended offsetof / offset tests
thomask
parents: 171
diff changeset
3 // $Author$
171
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
4
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
5 // .offset is depricated, use .offsetof
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
6
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
7 module dstress.nocompile.offset_01;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
8
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
9 struct MyStruct{
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
10 int a;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
11 int b;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
12 }
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
13
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
14 int main(){
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
15 MyStruct s;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
16
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
17 assert(s.a.offset >= 0);
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
18 assert(s.b.offset >= 0);
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
19 assert(s.a.offset != s.b.offset);
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
20
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
21 return 0;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
22 }