annotate nocompile/offset_03.d @ 171:e2ba37f5b797

added .offset deprication tests
author thomask
date Wed, 01 Dec 2004 12:41:29 +0000
parents
children e5bbb877feb9
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$
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
3 // Author$
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
4
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
5 // .offset isn't supported for unions
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
6
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
7 module dstress.nocompile.offset_03;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
8
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
9 union MyUnion{
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 MyUnion u;
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
16
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
17 assert(u.a.offset >= 0);
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
18 assert(u.b.offset >= 0);
e2ba37f5b797 added .offset deprication tests
thomask
parents:
diff changeset
19 assert(u.a.offset != u.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 }