annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1537
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
1 // $HeadURL$
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
2 // $Date$
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
3 // $Author$
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
4
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
5 // @author@ Don Clugston <clugdbug@yahoo.com.au>
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
6 // @date@ 2007-04-30
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1204
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
8 // @desc@ [Issue 1204] segfault using struct in CTFE
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
9
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
10 module dstress.run.s.struct_30_A;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
11
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
12 struct S {
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
13 int a = 0xABCD_1234;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
14 int b = 0xC0FF_EEEE;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
15 }
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
16
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
17 S foo(){
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
18 int q = 0;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
19 int unused;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
20 int unused2;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
21 return S(q, 0);
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
22 }
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
23
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
24 int main(){
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
25 const s = foo();
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
26 if((0xABCD_1234 != s.a) || (0xC0FF_EEEE != s.b)){
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
27 assert(0);
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
28 }
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
29
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
30 return 0;
457db9394771 [Issue 1204] segfault using struct in CTFE
thomask
parents:
diff changeset
31 }