This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add tests for mX?PUSH[inup] macros.
[perl5.git] / ext / XS / APItest / APItest.xs
index 02a1694..df43b89 100644 (file)
@@ -175,3 +175,71 @@ void
 print_flush()
        CODE:
        fflush(stdout);
 print_flush()
        CODE:
        fflush(stdout);
+
+void
+mpushp()
+       PPCODE:
+       EXTEND(SP, 3);
+       mPUSHp("one", 3);
+       mPUSHp("two", 3);
+       mPUSHp("three", 5);
+       XSRETURN(3);
+
+void
+mpushn()
+       PPCODE:
+       EXTEND(SP, 3);
+       mPUSHn(0.5);
+       mPUSHn(-0.25);
+       mPUSHn(0.125);
+       XSRETURN(3);
+
+void
+mpushi()
+       PPCODE:
+       EXTEND(SP, 3);
+       mPUSHn(-1);
+       mPUSHn(2);
+       mPUSHn(-3);
+       XSRETURN(3);
+
+void
+mpushu()
+       PPCODE:
+       EXTEND(SP, 3);
+       mPUSHn(1);
+       mPUSHn(2);
+       mPUSHn(3);
+       XSRETURN(3);
+
+void
+mxpushp()
+       PPCODE:
+       mXPUSHp("one", 3);
+       mXPUSHp("two", 3);
+       mXPUSHp("three", 5);
+       XSRETURN(3);
+
+void
+mxpushn()
+       PPCODE:
+       mXPUSHn(0.5);
+       mXPUSHn(-0.25);
+       mXPUSHn(0.125);
+       XSRETURN(3);
+
+void
+mxpushi()
+       PPCODE:
+       mXPUSHn(-1);
+       mXPUSHn(2);
+       mXPUSHn(-3);
+       XSRETURN(3);
+
+void
+mxpushu()
+       PPCODE:
+       mXPUSHn(1);
+       mXPUSHn(2);
+       mXPUSHn(3);
+       XSRETURN(3);