Mercurial > projects > dstress
annotate run/u/union_17_C.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 |
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_C; |
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 Bar { |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
12 union { |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
13 union { |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
14 Foo f; |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
15 } |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
16 } |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
17 } |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
18 |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
19 struct Foo { |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
20 int i; |
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 static if(Foo.sizeof != Bar.sizeof){ |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
24 static assert(0); |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
25 } |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
26 |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
27 int main(){ |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
28 Foo a; |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
29 a.i = 2; |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
30 |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
31 Bar b; |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
32 b.f = a; |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
33 |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
34 a.i = 3; |
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 if(a.i != 3){ |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
37 assert(0); |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
38 } |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
39 |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
40 if(b.f.i != 2){ |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
41 assert(0); |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
42 } |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
43 |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
44 return 0; |
439495a3c7c4
weird crash when nesting unions and structs; code order dependent
thomask
parents:
diff
changeset
|
45 } |