When code is loaded through an @INC-hook, and when this hook
[p5sagit/p5-mst-13.2.git] / t / op / threads.t
index 7fecba1..f699fc2 100644 (file)
@@ -18,7 +18,7 @@ BEGIN {
        print "1..0 # Skip: no dynamic loading on miniperl, no threads\n";
        exit 0;
      }
-     plan(4);
+     plan(5);
 }
 use threads;
 
@@ -96,3 +96,13 @@ sub do_sort_threads {
 
 do_sort_threads(2);        # crashes
 ok(1);
+
+# Change 24643 made the mistake of assuming that CvCONST can only be true on
+# XSUBs. Somehow it can also end up on perl subs.
+fresh_perl_is(<<'EOI', 'ok', { }, 'cloning constant subs');
+use constant x=>1;
+use threads;
+$SIG{__WARN__} = sub{};
+async sub {};
+print "ok";
+EOI