Mercurial > projects > dstress
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 |
rev | line source |
---|---|
171 | 1 // $HeadURL$ |
2 // $Date$ | |
172 | 3 // $Author$ |
171 | 4 |
5 // .offset is depricated, use .offsetof | |
6 | |
7 module dstress.nocompile.offset_01; | |
8 | |
9 struct MyStruct{ | |
10 int a; | |
11 int b; | |
12 } | |
13 | |
14 int main(){ | |
15 MyStruct s; | |
16 | |
17 assert(s.a.offset >= 0); | |
18 assert(s.b.offset >= 0); | |
19 assert(s.a.offset != s.b.offset); | |
20 | |
21 return 0; | |
22 } |