Front page | perl.cvs.parrot |
Postings from December 2008
[svn:parrot] r34297 - trunk/t/src
From:
chromatic
Date:
December 23, 2008 14:15
Subject:
[svn:parrot] r34297 - trunk/t/src
Message ID:
20081223221508.11107CBA12@x12.develooper.com
Author: chromatic
Date: Tue Dec 23 14:15:07 2008
New Revision: 34297
Modified:
trunk/t/src/compiler.t
Log:
[t] Removed a test of imcc_compile_pir() as Parrot_compile_string() does a much
better job and we already expose that anyway. See RT #61154 for the
motivation.
Modified: trunk/t/src/compiler.t
==============================================================================
--- trunk/t/src/compiler.t (original)
+++ trunk/t/src/compiler.t Tue Dec 23 14:15:07 2008
@@ -10,7 +10,7 @@
$^O eq 'MSWin32'
? plan( skip_all => 'linking problem' )
- : plan( tests => 6 );
+ : plan( tests => 5 );
=head1 NAME
@@ -27,90 +27,6 @@
=cut
-SKIP: {
- skip( 'compreg disabled/imcc_compile_pir() not exported', 1 );
- c_output_is( <<'CODE', <<'OUTPUT', "compreg/compile" );
-
-#include <stdio.h>
-#include "parrot/parrot.h"
-#include "parrot/embed.h"
-
-static opcode_t *
-run(Parrot_Interp interp, int argc, char *argv[])
-{
- const char *c_src = ".sub main :main\n" " print \"ok\\n\"\n" ".end\n";
-
- STRING *src, *smain;
- PMC *prog, *entry;
- opcode_t *dest;
-
- /* get PIR compiler - TODO API */
- PMC *compreg = Parrot_PMC_get_pmc_keyed_int(interp,
- interp->iglobals,
- IGLOBALS_COMPREG_HASH);
- STRING *pir = const_string(interp, "PIR");
- PMC *comp = Parrot_PMC_get_pmc_keyed_str(interp, compreg, pir);
-
- if (PMC_IS_NULL(comp) || !Parrot_PMC_defined(interp, comp)) {
- Parrot_io_eprintf(interp, "Pir compiler not loaded");
- exit(EXIT_FAILURE);
- }
-
- /* compile source */
- prog = imcc_compile_pir(interp, c_src);
-
- if (PMC_IS_NULL(prog) || !Parrot_PMC_defined(interp, prog)) {
- Parrot_io_eprintf(interp, "Pir compiler returned no prog");
- exit(EXIT_FAILURE);
- }
-
- /* keep eval PMC alive */
- dod_register_pmc(interp, prog);
-
- /* locate function to run */
- smain = const_string(interp, "main");
- entry = Parrot_find_global_cur(interp, smain);
-
- /* location of the entry */
- interp->current_cont = new_ret_continuation_pmc(interp, NULL);
- dest = Parrot_PMC_invoke(interp, entry, NULL);
-
- /* where to start */
- interp->resume_offset = dest -interp->code->base.data;
-
- /* and go */
- Parrot_runcode(interp, argc, argv);
- return NULL;
-}
-
-int
-main(int margc, char *margv[])
-{
- Parrot_Interp interp;
- PackFile *pf;
- int argc = 1;
- char *argv[] = { "test", NULL };
-
- PackFile_Segment *seg;
-
- /* Interpreter set-up */
- interp = Parrot_new(NULL);
- if (interp == NULL)
- return 1;
-
- /* dummy pf and segment to get things started */
- pf = PackFile_new_dummy(interp, "test_code");
-
- /* Parrot_set_flag(interp, PARROT_TRACE_FLAG); */
- run(interp, argc, argv);
- Parrot_exit(interp, 0);
- return 0;
-}
-CODE
-ok
-OUTPUT
-}
-
c_output_is( <<'CODE', <<'OUTPUT', "Parrot Compile API Single call" );
#include <stdio.h>
-
[svn:parrot] r34297 - trunk/t/src
by chromatic