+
+# XS
+
+{
+ my $desc = 'exception thrown from XS';
+ local $@;
+ eval {
+ sub {
+ &uplevel(\&uplevel => \1, HERE);
+ }->();
+ };
+ my $line = $^P ? '\d+' : __LINE__-2; # The error happens at the target frame.
+ my $file = $^P ? '\S+' : quotemeta $0;
+ like $@,
+ qr/^First argument to uplevel must be a code reference at $file line $line/,
+ "$desc: correct error";
+}