mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01:00
Add test for GC scanning data segment.
This commit is contained in:
15
tests/mini/gc_datasegment.d
Normal file
15
tests/mini/gc_datasegment.d
Normal file
@@ -0,0 +1,15 @@
|
||||
extern(C) void gc_collect();
|
||||
|
||||
class C
|
||||
{
|
||||
int i = 42;
|
||||
}
|
||||
|
||||
C data;
|
||||
|
||||
void main()
|
||||
{
|
||||
data = new C;
|
||||
gc_collect();
|
||||
assert(data.i == 42);
|
||||
}
|
||||
Reference in New Issue
Block a user