diff --git a/test/runnable/testgc2.d b/test/runnable/testgc2.d index ba9519fc1cf5..0d7ab8c4e3e0 100644 --- a/test/runnable/testgc2.d +++ b/test/runnable/testgc2.d @@ -9,16 +9,12 @@ import core.exception : OutOfMemoryError; void test1() { - version (none) - { - } - else - { printf("This should not take a while\n"); try { - long[] l = new long[ptrdiff_t.max]; - assert(0); + long[] l = new long[ptrdiff_t.max]; + printf("%lu\n", cast(ulong)l.capacity); // Make sure l is not optimized out. + assert(0); } catch (OutOfMemoryError o) { @@ -27,14 +23,14 @@ void test1() printf("This may take a while\n"); try { - byte[] b = new byte[size_t.max / 3]; - version (Windows) - assert(0); + byte[] b = new byte[size_t.max / 3]; + printf("%lu\n", cast(ulong)b.capacity); // Make sure b is not optimized out. + version (Windows) + assert(0); } catch (OutOfMemoryError o) { } - } } /*******************************************/