diff --git a/src/testsuite.in b/src/testsuite.in
index 25c14915c91e419de5acd2f70f76f89e0b36b1a2..aa20178bf999da41e0b3897087b1161f30400d6f 100644
--- a/src/testsuite.in
+++ b/src/testsuite.in
@@ -440,6 +440,15 @@ test_eval_error([[
   X()->s = (mixed) X();
 ]])
 
+test_any([[
+  // Bug 6062
+  class C { mapping options = ([ 1:1 ]); };
+  C c = C();
+  c->options[3] = 3;
+  c = C();
+  return sizeof(c->options) == 1;
+]], 1)
+
 dnl bug in for loop optimization in combination with +=
 
 test_any([[