annotate run/u/union_17_I.d @ 1319:81222734adf3

sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
author thomask
date Sun, 31 Dec 2006 19:58:06 +0000
parents 439495a3c7c4
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1033
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
1 // $HeadURL$
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
2 // $Date$
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
3 // $Author$
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
4
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
5 // @author@ <h3r3tic@mat.uni.torun.pl>
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
6 // @date@ 2006-05-27
1319
81222734adf3 sed'ed replacement of new:...http.d.puremagic.co... with http://d.puremagic.com/issues/show_bug.cgi?...
thomask
parents: 1033
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=158
1033
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
8
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
9 module dstress.run.u.union_17_I;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
10
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
11 struct Foo {
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
12 int i;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
13 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
14
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
15 struct Bar {
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
16 union {
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
17 struct {
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
18 union {
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
19 Foo f;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
20 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
21 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
22 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
23 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
24
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
25 static if(Foo.sizeof != Bar.sizeof){
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
26 static assert(0);
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
27 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
28
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
29 int main(){
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
30 Foo a;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
31 a.i = 2;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
32
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
33 Bar b;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
34 b.f = a;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
35
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
36 a.i = 3;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
37
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
38 if(a.i != 3){
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
39 assert(0);
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
40 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
41
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
42 if(b.f.i != 2){
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
43 assert(0);
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
44 }
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
45
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
46 return 0;
439495a3c7c4 weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff changeset
47 }