1 #define PERL_IN_XS_APITEST
7 typedef PTR_TBL_t *XS__APItest__PtrTable;
11 #define MY_CXT_KEY "XS::APItest::_guts" XS_VERSION
29 /* indirect functions to test the [pa]MY_CXT macros */
32 my_cxt_getint_p(pMY_CXT)
38 my_cxt_setint_p(pMY_CXT_ int i)
44 my_cxt_getsv_interp_context(void)
47 dMY_CXT_INTERP(my_perl);
52 my_cxt_getsv_interp(void)
59 my_cxt_setsv_p(SV* sv _pMY_CXT)
65 /* from exception.c */
66 int apitest_exception(int);
68 /* from core_or_not.inc */
69 bool sv_setsv_cow_hashkey_core(void);
70 bool sv_setsv_cow_hashkey_notcore(void);
72 /* A routine to test hv_delayfree_ent
73 (which itself is tested by testing on hv_free_ent */
75 typedef void (freeent_function)(pTHX_ HV *, register HE *);
78 test_freeent(freeent_function *f) {
81 HV *test_hash = newHV();
88 victim = (HE*)safemalloc(sizeof(HE));
90 /* Storing then deleting something should ensure that a hash entry is
92 hv_store(test_hash, "", 0, &PL_sv_yes, 0);
93 hv_delete(test_hash, "", 0, 0);
95 /* We need to "inline" new_he here as it's static, and the functions we
96 test expect to be able to call del_HE on the HE */
97 if (!PL_body_roots[HE_SVSLOT])
98 croak("PL_he_root is 0");
99 victim = (HE*) PL_body_roots[HE_SVSLOT];
100 PL_body_roots[HE_SVSLOT] = HeNEXT(victim);
103 victim->hent_hek = Perl_share_hek(aTHX_ "", 0, 0);
105 test_scalar = newSV(0);
106 SvREFCNT_inc(test_scalar);
107 HeVAL(victim) = test_scalar;
109 /* Need this little game else we free the temps on the return stack. */
110 results[0] = SvREFCNT(test_scalar);
112 results[1] = SvREFCNT(test_scalar);
113 f(aTHX_ test_hash, victim);
114 results[2] = SvREFCNT(test_scalar);
116 results[3] = SvREFCNT(test_scalar);
121 } while (++i < sizeof(results)/sizeof(results[0]));
123 /* Goodbye to our extra reference. */
124 SvREFCNT_dec(test_scalar);
129 bitflip_key(pTHX_ IV action, SV *field) {
130 MAGIC *mg = mg_find(field, PERL_MAGIC_uvar);
132 if (mg && (keysv = mg->mg_obj)) {
134 const char *p = SvPV(keysv, len);
137 SV *newkey = newSV(len);
138 char *new_p = SvPVX(newkey);
141 const char *const end = p + len;
144 UV chr = utf8_to_uvuni((U8 *)p, &len);
145 new_p = (char *)uvuni_to_utf8((U8 *)new_p, chr ^ 32);
151 *new_p++ = *p++ ^ 32;
154 SvCUR_set(newkey, SvCUR(keysv));
164 rot13_key(pTHX_ IV action, SV *field) {
165 MAGIC *mg = mg_find(field, PERL_MAGIC_uvar);
167 if (mg && (keysv = mg->mg_obj)) {
169 const char *p = SvPV(keysv, len);
172 SV *newkey = newSV(len);
173 char *new_p = SvPVX(newkey);
175 /* There's a deliberate fencepost error here to loop len + 1 times
176 to copy the trailing \0 */
179 /* Try doing this cleanly and clearly in EBCDIC another way: */
181 case 'A': new_c = 'N'; break;
182 case 'B': new_c = 'O'; break;
183 case 'C': new_c = 'P'; break;
184 case 'D': new_c = 'Q'; break;
185 case 'E': new_c = 'R'; break;
186 case 'F': new_c = 'S'; break;
187 case 'G': new_c = 'T'; break;
188 case 'H': new_c = 'U'; break;
189 case 'I': new_c = 'V'; break;
190 case 'J': new_c = 'W'; break;
191 case 'K': new_c = 'X'; break;
192 case 'L': new_c = 'Y'; break;
193 case 'M': new_c = 'Z'; break;
194 case 'N': new_c = 'A'; break;
195 case 'O': new_c = 'B'; break;
196 case 'P': new_c = 'C'; break;
197 case 'Q': new_c = 'D'; break;
198 case 'R': new_c = 'E'; break;
199 case 'S': new_c = 'F'; break;
200 case 'T': new_c = 'G'; break;
201 case 'U': new_c = 'H'; break;
202 case 'V': new_c = 'I'; break;
203 case 'W': new_c = 'J'; break;
204 case 'X': new_c = 'K'; break;
205 case 'Y': new_c = 'L'; break;
206 case 'Z': new_c = 'M'; break;
207 case 'a': new_c = 'n'; break;
208 case 'b': new_c = 'o'; break;
209 case 'c': new_c = 'p'; break;
210 case 'd': new_c = 'q'; break;
211 case 'e': new_c = 'r'; break;
212 case 'f': new_c = 's'; break;
213 case 'g': new_c = 't'; break;
214 case 'h': new_c = 'u'; break;
215 case 'i': new_c = 'v'; break;
216 case 'j': new_c = 'w'; break;
217 case 'k': new_c = 'x'; break;
218 case 'l': new_c = 'y'; break;
219 case 'm': new_c = 'z'; break;
220 case 'n': new_c = 'a'; break;
221 case 'o': new_c = 'b'; break;
222 case 'p': new_c = 'c'; break;
223 case 'q': new_c = 'd'; break;
224 case 'r': new_c = 'e'; break;
225 case 's': new_c = 'f'; break;
226 case 't': new_c = 'g'; break;
227 case 'u': new_c = 'h'; break;
228 case 'v': new_c = 'i'; break;
229 case 'w': new_c = 'j'; break;
230 case 'x': new_c = 'k'; break;
231 case 'y': new_c = 'l'; break;
232 case 'z': new_c = 'm'; break;
236 SvCUR_set(newkey, SvCUR(keysv));
248 rmagical_a_dummy(pTHX_ IV idx, SV *sv) {
252 STATIC MGVTBL rmagical_b = { 0 };
255 blockhook_csc_start(pTHX_ int full)
258 AV *const cur = GvAV(MY_CXT.cscgv);
260 SAVEGENERICSV(GvAV(MY_CXT.cscgv));
264 AV *const new_av = newAV();
266 for (i = 0; i <= av_len(cur); i++) {
267 av_store(new_av, i, newSVsv(*av_fetch(cur, i, 0)));
270 GvAV(MY_CXT.cscgv) = new_av;
275 blockhook_csc_pre_end(pTHX_ OP **o)
279 /* if we hit the end of a scope we missed the start of, we need to
280 * unconditionally clear @CSC */
281 if (GvAV(MY_CXT.cscgv) == MY_CXT.cscav && MY_CXT.cscav) {
282 av_clear(MY_CXT.cscav);
288 blockhook_test_start(pTHX_ int full)
293 if (MY_CXT.bhk_record) {
295 av_push(av, newSVpvs("start"));
296 av_push(av, newSViv(full));
297 av_push(MY_CXT.bhkav, newRV_noinc(MUTABLE_SV(av)));
302 blockhook_test_pre_end(pTHX_ OP **o)
306 if (MY_CXT.bhk_record)
307 av_push(MY_CXT.bhkav, newSVpvs("pre_end"));
311 blockhook_test_post_end(pTHX_ OP **o)
315 if (MY_CXT.bhk_record)
316 av_push(MY_CXT.bhkav, newSVpvs("post_end"));
320 blockhook_test_eval(pTHX_ OP *const o)
325 if (MY_CXT.bhk_record) {
327 av_push(av, newSVpvs("eval"));
328 av_push(av, newSVpv(OP_NAME(o), 0));
329 av_push(MY_CXT.bhkav, newRV_noinc(MUTABLE_SV(av)));
333 STATIC BHK bhk_csc, bhk_test;
336 my_peep (pTHX_ OP *o)
343 MY_CXT.orig_peep(aTHX_ o);
345 if (!MY_CXT.peep_recording)
348 for (; o; o = o->op_next) {
349 if (o->op_type == OP_CONST && cSVOPx_sv(o) && SvPOK(cSVOPx_sv(o))) {
350 av_push(MY_CXT.peep_recorder, newSVsv(cSVOPx_sv(o)));
356 my_rpeep (pTHX_ OP *o)
363 MY_CXT.orig_rpeep(aTHX_ o);
365 if (!MY_CXT.peep_recording)
368 for (; o; o = o->op_next) {
369 if (o->op_type == OP_CONST && cSVOPx_sv(o) && SvPOK(cSVOPx_sv(o))) {
370 av_push(MY_CXT.rpeep_recorder, newSVsv(cSVOPx_sv(o)));
375 #include "const-c.inc"
377 MODULE = XS::APItest:Hash PACKAGE = XS::APItest::Hash
379 INCLUDE: const-xs.inc
387 uf.uf_val = rot13_key;
391 sv_magic((SV*)hash, NULL, PERL_MAGIC_uvar, (char*)&uf, sizeof(uf));
400 uf.uf_val = bitflip_key;
404 sv_magic((SV*)hash, NULL, PERL_MAGIC_uvar, (char*)&uf, sizeof(uf));
407 #define UTF8KLEN(sv, len) (SvUTF8(sv) ? -(I32)len : (I32)len)
418 key = SvPV(key_sv, len);
419 RETVAL = hv_exists(hash, key, UTF8KLEN(key_sv, len));
424 exists_ent(hash, key_sv)
430 RETVAL = hv_exists_ent(hash, key_sv, 0);
435 delete(hash, key_sv, flags = 0)
444 key = SvPV(key_sv, len);
445 /* It's already mortal, so need to increase reference count. */
447 = SvREFCNT_inc(hv_delete(hash, key, UTF8KLEN(key_sv, len), flags));
452 delete_ent(hash, key_sv, flags = 0)
458 /* It's already mortal, so need to increase reference count. */
459 RETVAL = SvREFCNT_inc(hv_delete_ent(hash, key_sv, flags, 0));
464 store_ent(hash, key, value)
474 result = hv_store_ent(hash, key, copy, 0);
475 SvSetMagicSV(copy, value);
480 /* It's about to become mortal, so need to increase reference count.
482 RETVAL = SvREFCNT_inc(HeVAL(result));
487 store(hash, key_sv, value)
498 key = SvPV(key_sv, len);
500 result = hv_store(hash, key, UTF8KLEN(key_sv, len), copy, 0);
501 SvSetMagicSV(copy, value);
506 /* It's about to become mortal, so need to increase reference count.
508 RETVAL = SvREFCNT_inc(*result);
513 fetch_ent(hash, key_sv)
520 result = hv_fetch_ent(hash, key_sv, 0, 0);
525 RETVAL = newSVsv(HeVAL(result));
539 key = SvPV(key_sv, len);
540 result = hv_fetch(hash, key, UTF8KLEN(key_sv, len), 0);
545 RETVAL = newSVsv(*result);
549 #if defined (hv_common)
559 const char *key = NULL;
567 if ((svp = hv_fetchs(params, "hv", 0))) {
570 croak("common passed a non-reference for parameter hv");
573 if ((svp = hv_fetchs(params, "keysv", 0)))
575 if ((svp = hv_fetchs(params, "keypv", 0))) {
576 key = SvPV_const(*svp, klen);
580 if ((svp = hv_fetchs(params, "action", 0)))
582 if ((svp = hv_fetchs(params, "val", 0)))
584 if ((svp = hv_fetchs(params, "hash", 0)))
587 if ((svp = hv_fetchs(params, "hash_pv", 0))) {
588 PERL_HASH(hash, key, klen);
590 if ((svp = hv_fetchs(params, "hash_sv", 0))) {
592 const char *const p = SvPV(keysv, len);
593 PERL_HASH(hash, p, len);
596 result = (HE *)hv_common(hv, keysv, key, klen, flags, action, val, hash);
601 RETVAL = newSVsv(HeVAL(result));
610 test_freeent(&Perl_hv_free_ent);
614 test_hv_delayfree_ent()
616 test_freeent(&Perl_hv_delayfree_ent);
620 test_share_unshare_pvn(input)
629 pvx = SvPV(input, len);
630 PERL_HASH(hash, pvx, len);
631 p = sharepvn(pvx, len, hash);
632 RETVAL = newSVpvn(p, len);
633 unsharepvn(p, len, hash);
637 #if PERL_VERSION >= 9
640 refcounted_he_exists(key, level=0)
645 croak("level must be zero, not %"IVdf, level);
647 RETVAL = (Perl_refcounted_he_fetch(aTHX_ PL_curcop->cop_hints_hash,
649 != &PL_sv_placeholder);
654 refcounted_he_fetch(key, level=0)
659 croak("level must be zero, not %"IVdf, level);
661 RETVAL = Perl_refcounted_he_fetch(aTHX_ PL_curcop->cop_hints_hash, key,
663 SvREFCNT_inc(RETVAL);
671 sub TIEHASH { bless {}, $_[0] }
672 sub STORE { $_[0]->{$_[1]} = $_[2] }
673 sub FETCH { $_[0]->{$_[1]} }
674 sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
675 sub NEXTKEY { each %{$_[0]} }
676 sub EXISTS { exists $_[0]->{$_[1]} }
677 sub DELETE { delete $_[0]->{$_[1]} }
678 sub CLEAR { %{$_[0]} = () }
682 MODULE = XS::APItest:TempLv PACKAGE = XS::APItest::TempLv
688 SV * const lv = newSV_type(SVt_PVLV);
693 sv_magic(lv, NULL, PERL_MAGIC_substr, NULL, 0);
695 LvTARG(lv) = SvREFCNT_inc_simple(sv);
696 LvTARGOFF(lv) = len == 0 ? 0 : 1;
697 LvTARGLEN(lv) = len < 2 ? 0 : len-2;
700 ST(0) = sv_2mortal(lv);
704 MODULE = XS::APItest::PtrTable PACKAGE = XS::APItest::PtrTable PREFIX = ptr_table_
707 ptr_table_new(classname)
708 const char * classname
710 PUSHs(sv_setref_pv(sv_newmortal(), classname, (void*)ptr_table_new()));
714 XS::APItest::PtrTable table
716 ptr_table_free(table);
719 ptr_table_store(table, from, to)
720 XS::APItest::PtrTable table
724 ptr_table_store(table, from, to);
727 ptr_table_fetch(table, from)
728 XS::APItest::PtrTable table
731 RETVAL = PTR2UV(ptr_table_fetch(table, from));
736 ptr_table_split(table)
737 XS::APItest::PtrTable table
740 ptr_table_clear(table)
741 XS::APItest::PtrTable table
743 MODULE = XS::APItest PACKAGE = XS::APItest
752 MY_CXT.sv = newSVpv("initial",0);
754 MY_CXT.bhkav = get_av("XS::APItest::bhkav", GV_ADDMULTI);
755 MY_CXT.bhk_record = 0;
757 BhkENTRY_set(&bhk_test, start, blockhook_test_start);
758 BhkENTRY_set(&bhk_test, pre_end, blockhook_test_pre_end);
759 BhkENTRY_set(&bhk_test, post_end, blockhook_test_post_end);
760 BhkENTRY_set(&bhk_test, eval, blockhook_test_eval);
761 Perl_blockhook_register(aTHX_ &bhk_test);
763 MY_CXT.cscgv = gv_fetchpvs("XS::APItest::COMPILE_SCOPE_CONTAINER",
764 GV_ADDMULTI, SVt_PVAV);
765 MY_CXT.cscav = GvAV(MY_CXT.cscgv);
767 BhkENTRY_set(&bhk_csc, start, blockhook_csc_start);
768 BhkENTRY_set(&bhk_csc, pre_end, blockhook_csc_pre_end);
769 Perl_blockhook_register(aTHX_ &bhk_csc);
771 MY_CXT.peep_recorder = newAV();
772 MY_CXT.rpeep_recorder = newAV();
774 MY_CXT.orig_peep = PL_peepp;
775 MY_CXT.orig_rpeep = PL_rpeepp;
777 PL_rpeepp = my_rpeep;
784 MY_CXT.sv = newSVpv("initial_clone",0);
785 MY_CXT.cscgv = gv_fetchpvs("XS::APItest::COMPILE_SCOPE_CONTAINER",
786 GV_ADDMULTI, SVt_PVAV);
788 MY_CXT.bhkav = get_av("XS::APItest::bhkav", GV_ADDMULTI);
789 MY_CXT.bhk_record = 0;
790 MY_CXT.peep_recorder = newAV();
791 MY_CXT.rpeep_recorder = newAV();
797 printf("%5.3f\n",val);
802 #ifdef HAS_LONG_DOUBLE
813 #ifdef HAS_LONG_DOUBLE
814 # if defined(PERL_PRIfldbl) && (LONG_DOUBLESIZE > DOUBLESIZE)
815 long double val = 7.0;
816 printf("%5.3" PERL_PRIfldbl "\n",val);
819 printf("%5.3f\n",val);
839 printf("%5.3f\n",val);
916 call_sv(sv, flags, ...)
922 for (i=0; i<items-2; i++)
923 ST(i) = ST(i+2); /* pop first two args */
927 i = call_sv(sv, flags);
930 PUSHs(sv_2mortal(newSViv(i)));
933 call_pv(subname, flags, ...)
939 for (i=0; i<items-2; i++)
940 ST(i) = ST(i+2); /* pop first two args */
944 i = call_pv(subname, flags);
947 PUSHs(sv_2mortal(newSViv(i)));
950 call_method(methname, flags, ...)
956 for (i=0; i<items-2; i++)
957 ST(i) = ST(i+2); /* pop first two args */
961 i = call_method(methname, flags);
964 PUSHs(sv_2mortal(newSViv(i)));
974 i = eval_sv(sv, flags);
977 PUSHs(sv_2mortal(newSViv(i)));
980 eval_pv(p, croak_on_error)
986 PUSHs(eval_pv(p, croak_on_error));
996 apitest_exception(throw_e)
1006 Perl_croak(aTHX_ "%s", SvPV_nolen(sv));
1009 Perl_croak(aTHX_ NULL);
1015 RETVAL = newRV_inc((SV*)PL_strtab);
1023 RETVAL = my_cxt_getint_p(aMY_CXT);
1032 my_cxt_setint_p(aMY_CXT_ i);
1039 ST(0) = how ? my_cxt_getsv_interp_context() : my_cxt_getsv_interp();
1047 SvREFCNT_dec(MY_CXT.sv);
1048 my_cxt_setsv_p(sv _aMY_CXT);
1052 sv_setsv_cow_hashkey_core()
1055 sv_setsv_cow_hashkey_notcore()
1058 rmagical_cast(sv, type)
1064 if (!SvOK(sv) || !SvROK(sv) || !SvOK(type)) { XSRETURN_UNDEF; }
1066 if (SvTYPE(sv) != SVt_PVHV) { XSRETURN_UNDEF; }
1067 uf.uf_val = rmagical_a_dummy;
1070 if (SvTRUE(type)) { /* b */
1071 sv_magicext(sv, NULL, PERL_MAGIC_ext, &rmagical_b, NULL, 0);
1073 sv_magic(sv, NULL, PERL_MAGIC_uvar, (char *) &uf, sizeof(uf));
1081 if (!SvOK(sv) || !SvROK(sv)) { XSRETURN_UNDEF; }
1084 mXPUSHu(SvFLAGS(sv) & SVs_GMG);
1085 mXPUSHu(SvFLAGS(sv) & SVs_SMG);
1086 mXPUSHu(SvFLAGS(sv) & SVs_RMG);
1093 const PERL_CONTEXT *cx, *dbcx;
1098 cx = caller_cx(level, &dbcx);
1101 pv = CopSTASHPV(cx->blk_oldcop);
1102 ST(0) = pv ? sv_2mortal(newSVpv(pv, 0)) : &PL_sv_undef;
1103 gv = CvGV(cx->blk_sub.cv);
1104 ST(1) = isGV(gv) ? sv_2mortal(newSVpv(GvNAME(gv), 0)) : &PL_sv_undef;
1106 pv = CopSTASHPV(dbcx->blk_oldcop);
1107 ST(2) = pv ? sv_2mortal(newSVpv(pv, 0)) : &PL_sv_undef;
1108 gv = CvGV(dbcx->blk_sub.cv);
1109 ST(3) = isGV(gv) ? sv_2mortal(newSVpv(GvNAME(gv), 0)) : &PL_sv_undef;
1111 ST(4) = cop_hints_fetchpvs(cx->blk_oldcop, "foo");
1112 ST(5) = cop_hints_fetchpvn(cx->blk_oldcop, "foo", 3, 0, 0);
1113 ST(6) = cop_hints_fetchsv(cx->blk_oldcop,
1114 sv_2mortal(newSVpvn("foo", 3)), 0);
1116 hv = cop_hints_2hv(cx->blk_oldcop);
1117 ST(7) = hv ? sv_2mortal(newRV_noinc((SV *)hv)) : &PL_sv_undef;
1126 ST (0) = newSVpv (Perl_sv_peek (aTHX_ sv), 0);
1132 sv_inc(get_sv("XS::APItest::BEGIN_called", GV_ADD|GV_ADDMULTI));
1137 sv_inc(get_sv("XS::APItest::CHECK_called", GV_ADD|GV_ADDMULTI));
1142 sv_inc(get_sv("XS::APItest::UNITCHECK_called", GV_ADD|GV_ADDMULTI));
1147 sv_inc(get_sv("XS::APItest::INIT_called", GV_ADD|GV_ADDMULTI));
1152 sv_inc(get_sv("XS::APItest::END_called", GV_ADD|GV_ADDMULTI));
1155 utf16_to_utf8 (sv, ...)
1158 utf16_to_utf8_reversed = 1
1163 I32 got; /* Gah, badly thought out APIs */
1165 source = (U8 *)SvPVbyte(sv, len);
1166 /* Optionally only convert part of the buffer. */
1170 /* Mortalise this right now, as we'll be testing croak()s */
1171 dest = sv_2mortal(newSV(len * 3 / 2 + 1));
1173 utf16_to_utf8_reversed(source, (U8 *)SvPVX(dest), len, &got);
1175 utf16_to_utf8(source, (U8 *)SvPVX(dest), len, &got);
1177 SvCUR_set(dest, got);
1178 SvPVX(dest)[got] = '\0';
1184 my_exit(int exitcode)
1191 RETVAL = PL_sv_count;
1199 MY_CXT.bhk_record = on;
1201 av_clear(MY_CXT.bhkav);
1208 #define store_hint(KEY, VALUE) \
1209 sv_setiv_mg(*hv_fetchs(GvHV(PL_hintgv), KEY, 1), (VALUE))
1210 #define hint_ok(KEY, EXPECT) \
1211 ((svp = hv_fetchs(GvHV(PL_hintgv), KEY, 0)) && \
1212 (sv = *svp) && SvIV(sv) == (EXPECT) && \
1213 (sv = cop_hints_fetchpvs(&PL_compiling, KEY)) && \
1214 SvIV(sv) == (EXPECT))
1215 #define check_hint(KEY, EXPECT) \
1216 do { if (!hint_ok(KEY, EXPECT)) croak("fail"); } while(0)
1217 PL_hints |= HINT_LOCALIZE_HH;
1220 PL_hints &= HINT_INTEGER;
1221 store_hint("t0", 123);
1222 store_hint("t1", 456);
1223 if (PL_hints & HINT_INTEGER) croak("fail");
1224 check_hint("t0", 123); check_hint("t1", 456);
1227 if (PL_hints & HINT_INTEGER) croak("fail");
1228 check_hint("t0", 123); check_hint("t1", 456);
1229 PL_hints |= HINT_INTEGER;
1230 store_hint("t0", 321);
1231 if (!(PL_hints & HINT_INTEGER)) croak("fail");
1232 check_hint("t0", 321); check_hint("t1", 456);
1234 if (PL_hints & HINT_INTEGER) croak("fail");
1235 check_hint("t0", 123); check_hint("t1", 456);
1238 if (PL_hints & HINT_INTEGER) croak("fail");
1239 check_hint("t0", 123); check_hint("t1", 456);
1240 store_hint("t1", 654);
1241 if (PL_hints & HINT_INTEGER) croak("fail");
1242 check_hint("t0", 123); check_hint("t1", 654);
1244 if (PL_hints & HINT_INTEGER) croak("fail");
1245 check_hint("t0", 123); check_hint("t1", 456);
1256 PL_hints |= HINT_LOCALIZE_HH;
1259 sv_setiv_mg(*hv_fetchs(GvHV(PL_hintgv), "t0", 1), 123);
1260 if (SvIV(cop_hints_fetchpvs(&PL_compiling, "t0")) != 123) croak("fail");
1261 a = newHVhv(GvHV(PL_hintgv));
1263 sv_setiv_mg(*hv_fetchs(a, "t0", 1), 456);
1264 if (SvIV(cop_hints_fetchpvs(&PL_compiling, "t0")) != 123) croak("fail");
1265 b = hv_copy_hints_hv(a);
1267 sv_setiv_mg(*hv_fetchs(b, "t0", 1), 789);
1268 if (SvIV(cop_hints_fetchpvs(&PL_compiling, "t0")) != 789) croak("fail");
1276 av_clear(MY_CXT.peep_recorder);
1277 av_clear(MY_CXT.rpeep_recorder);
1278 MY_CXT.peep_recording = 1;
1285 MY_CXT.peep_recording = 0;
1292 RETVAL = newRV_inc((SV *)MY_CXT.peep_recorder);
1301 RETVAL = newRV_inc((SV *)MY_CXT.rpeep_recorder);
1310 stash = gv_stashpv("XS::APItest::TempLv", 0);
1312 meth = hv_fetchs(stash, "make_temp_mg_lv", 0);
1314 croak("lost method 'make_temp_mg_lv'");