Mercurial > projects > dstress
annotate run/l/lazy_03_D.d @ 1451:623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
Mark Guidarelli <guido@grumpy-cat.com>
2007-03-31
http://d.puremagic.com/issues/show_bug.cgi?id=1088
author | thomask |
---|---|
date | Wed, 04 Apr 2007 20:34:04 +0000 |
parents | |
children |
rev | line source |
---|---|
1451
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
1 // $HeadURL$ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
2 // $Date$ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
3 // $Author$ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
4 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
5 // @author@ Mark Guidarelli <guido@grumpy-cat.com> |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
6 // @date@ 2007-03-31 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1088 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
8 // @desc@ [Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
9 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
10 module dstress.run.l.lazy_03_D; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
11 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
12 import std.stdarg; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
13 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
14 int step; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
15 int[] master = [0x12_34_56_78, 0x12_34_56_78, 0xAB_CD_EF_00, 0xAB_CD_EF_00]; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
16 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
17 void test(...){ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
18 if(1 != _arguments.length){ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
19 assert(0); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
20 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
21 if(typeid(int) != _arguments[0]){ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
22 assert(0); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
23 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
24 int i = va_arg!(int)(_argptr); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
25 if(master[step] != i){ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
26 assert(0); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
27 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
28 step++; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
29 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
30 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
31 int foo() { |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
32 test(0x12_34_56_78); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
33 return 0xAB_CD_EF_00; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
34 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
35 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
36 void bar(lazy int[] bla) { |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
37 foreach (elem; bla){ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
38 test(elem); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
39 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
40 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
41 |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
42 int main() { |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
43 bar([foo(), foo()]); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
44 if(step != master.length){ |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
45 assert(0); |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
46 } |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
47 return 0; |
623963e374c5
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
thomask
parents:
diff
changeset
|
48 } |