annotate tests/mini/aa7.d @ 490:f8c979770af3

Fixed a critical bug in the runtime, where _d_allocmemoryT would mark the memory block as having pointers (for scanning) opposite of what it should. So pointers would not be seen and freed. Should fix a bunch of regressions with AAs.
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Sun, 10 Aug 2008 17:28:01 +0200
parents a34078905d01
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
490
f8c979770af3 Fixed a critical bug in the runtime, where _d_allocmemoryT would mark
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
1 // adapted from dstress.run.a.associative_array_19_<n> to catch regressions early
486
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
2
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
3 module mini.aa7;
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
4
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
5 extern (C) int printf(char*, ...);
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
6 extern (C) void gc_collect();
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
7
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
8
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
9 int main(){
490
f8c979770af3 Fixed a critical bug in the runtime, where _d_allocmemoryT would mark
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
10 char*[char] aa;
486
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
11
490
f8c979770af3 Fixed a critical bug in the runtime, where _d_allocmemoryT would mark
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
12 char key = 'a';
f8c979770af3 Fixed a critical bug in the runtime, where _d_allocmemoryT would mark
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
13 aa[key] = &key;
486
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
14 gc_collect();
490
f8c979770af3 Fixed a critical bug in the runtime, where _d_allocmemoryT would mark
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
15 assert(aa[key] == &key);
f8c979770af3 Fixed a critical bug in the runtime, where _d_allocmemoryT would mark
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents: 486
diff changeset
16 assert(key in aa);
486
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
17
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
18 return 0;
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
19 }
a34078905d01 Added pragma(llvmdc, "string") for misc per-module compiler configuration, currently "string" can only be "verbose" which forces -vv for module it appears in.
Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
parents:
diff changeset
20