comparison run/s/struct_30_A.d @ 1537:457db9394771

[Issue 1204] segfault using struct in CTFE Don Clugston <clugdbug@yahoo.com.au> 2007-04-30 http://d.puremagic.com/issues/show_bug.cgi?id=1204
author thomask
date Mon, 07 May 2007 05:21:26 +0000
parents
children
comparison
equal deleted inserted replaced
1536:89775df1607d 1537:457db9394771
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Don Clugston <clugdbug@yahoo.com.au>
6 // @date@ 2007-04-30
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1204
8 // @desc@ [Issue 1204] segfault using struct in CTFE
9
10 module dstress.run.s.struct_30_A;
11
12 struct S {
13 int a = 0xABCD_1234;
14 int b = 0xC0FF_EEEE;
15 }
16
17 S foo(){
18 int q = 0;
19 int unused;
20 int unused2;
21 return S(q, 0);
22 }
23
24 int main(){
25 const s = foo();
26 if((0xABCD_1234 != s.a) || (0xC0FF_EEEE != s.b)){
27 assert(0);
28 }
29
30 return 0;
31 }