Files
ldc/tests/mini/aa7.d
Tomas Lindquist Olsen 43567aca3b 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.
2008-08-10 17:28:01 +02:00

21 lines
329 B
D

// adapted from dstress.run.a.associative_array_19_<n> to catch regressions early
module mini.aa7;
extern (C) int printf(char*, ...);
extern (C) void gc_collect();
int main(){
char*[char] aa;
char key = 'a';
aa[key] = &key;
gc_collect();
assert(aa[key] == &key);
assert(key in aa);
return 0;
}