1140
|
1 // $HeadURL$
|
|
2 // $Date$
|
|
3 // $Author$
|
|
4
|
|
5 // @author@ Johan Granberg <lijat.meREM@OVEgmail.com>
|
|
6 // @date@ 2006-09-14
|
|
7 // @uri@ news:eeb08s$2p5n$1@digitaldaemon.com
|
1410
|
8 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1034
|
1140
|
9 // @desc@ Incorrect code generation -O2 gdc
|
|
10
|
|
11 module dstress.run.o.odd_bug_09_A;
|
|
12
|
|
13 struct S{
|
|
14 union{
|
|
15 void delegate(uint) del;
|
|
16 void function(uint) fp;
|
|
17 }
|
|
18 static S opCall(void function(uint) c,uint i){
|
|
19 S a;
|
|
20 a.fp = c;
|
|
21 return a;
|
|
22 }
|
|
23 }
|
|
24
|
|
25 S s;
|
|
26
|
|
27 static this(){
|
|
28 s = S(&foo, 0);
|
|
29 }
|
|
30
|
|
31 void foo(uint i){
|
|
32 }
|
|
33
|
|
34 int main(){
|
|
35 foo(0);
|
|
36 if(! s.fp){
|
|
37 assert(0);
|
|
38 }
|
|
39 s.fp(0);
|
|
40
|
|
41 return 0;
|
|
42 }
|
|
43
|