[svn:parrot] r39943 - in trunk: src/dynoplibs t/dynoplibs

coke at svn.parrot.org coke at svn.parrot.org
Wed Jul 8 01:57:20 UTC 2009


Author: coke
Date: Wed Jul  8 01:57:19 2009
New Revision: 39943
URL: https://trac.parrot.org/parrot/changeset/39943

Log:
TT #450 - remove (most of) the DEPRECATED myops dynamic ops

Leave one as a placeholder for now.

Modified:
   trunk/src/dynoplibs/myops.ops
   trunk/t/dynoplibs/myops.t

Modified: trunk/src/dynoplibs/myops.ops
==============================================================================
--- trunk/src/dynoplibs/myops.ops	Wed Jul  8 01:33:10 2009	(r39942)
+++ trunk/src/dynoplibs/myops.ops	Wed Jul  8 01:57:19 2009	(r39943)
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2003-2008, Parrot Foundation.
+  Copyright (C) 2003-2009, Parrot Foundation.
   $Id$
 */
 
@@ -10,7 +10,7 @@
 
 =head1 NAME
 
-myops.ops - Sample Dynamic Opcodes 2
+myops.ops - Sample Dynamic Opcodes
 
 =cut
 
@@ -29,94 +29,12 @@
 The famous and ever wanted opcode, proposed by Jos Visser in
 "We *need* this op! :-)".
 
-=item B<what_do_you_get_if_you_multiply_six_by_nine>(out INT)
-
-Alternate spelling of this op, proposed by Nicholas Clark. It might bring
-imcc to its limits due the lengthy name.
-
 =cut
 
 inline op fortytwo(out INT) {
     $1 = 42;
 }
 
-inline op what_do_you_get_if_you_multiply_six_by_nine(out STR) {
-    $1 = string_from_literal(interp, "fortytwo");
-}
-
-=item B<hcf>
-
-Halt and Catch Fire. Tries to crash Parrot.  Note that making a segfault here
-is a Bad Thing, so this relies instead on Well Supported end-this-process
-behavior.
-
-=cut
-
-op hcf() :flow {
-    abort();
-}
-
-=item B<q>
-
-Support for writing a very short quine.
-
-=cut
-
-op q() :flow {
-    Parrot_io_printf(interp, ".loadlib \"myops_ops\"\nq\n");
-    HALT();
-}
-
-=item B<bxand>(out INT, in INT, in INT)
-
-Binary operator, defined as A and B, but not BOTH.
-
-=cut
-
-op bxand(out INT, in INT, in INT) {
-    /* short circuit boolean logic */
-    $1 = 0;
-}
-
-=item B<alarm>(in NUM, in PMC)
-
-Call alarm handler sub $2 after $1 time has elapsed.
-
-=item B<alarm>(in NUM, in NUM, in PMC)
-
-Call alarm handler sub $3 after $1 time has elapsed, repeat after $2.
-
-=cut
-
-op alarm(in NUM, in PMC) {
-    Parrot_cx_schedule_timer(interp, NULL, $1, 0.0, 0, $2);
-}
-
-op alarm(in NUM, in NUM, in PMC) {
-    Parrot_cx_schedule_timer(interp, NULL, $1, $2, -1, $3);
-}
-
-=item B<conv_u2>(inout INT)
-
-Conversion of a two byte unsigned int to an INT.
-Formerly in dotgnu.ops.
-
-=item B<conv_i2>(inout INT)
-
-Conversion of a two byte signed int to an INT.
-Formerly in dotgnu.ops.
-
-=cut
-
-inline op conv_u2(inout INT) :base_core {
-  $1 = (INTVAL)((Parrot_UInt2)($1 & 0xffff));
-}
-
-inline op conv_i2(inout INT) :base_core {
-  $1 = (INTVAL)((Parrot_Int2)($1 & 0xffff));
-}
-
-
 =back
 
 =cut

Modified: trunk/t/dynoplibs/myops.t
==============================================================================
--- trunk/t/dynoplibs/myops.t	Wed Jul  8 01:33:10 2009	(r39942)
+++ trunk/t/dynoplibs/myops.t	Wed Jul  8 01:57:19 2009	(r39943)
@@ -6,7 +6,7 @@
 use warnings;
 use lib qw( . lib ../lib ../../lib );
 use Test::More;
-use Parrot::Test tests => 10;
+use Parrot::Test tests => 1;
 use Parrot::Config;
 
 =head1 NAME
@@ -40,255 +40,6 @@
 42
 OUTPUT
 
-pir_output_is( << 'CODE', << 'OUTPUT', "what_do_you_get_if_you_multiply_six_by_nine" );
-.loadlib "myops_ops"
-.sub main :main
-    $S0 = what_do_you_get_if_you_multiply_six_by_nine
-    print $S0
-    print "\n"
-.end
-CODE
-fortytwo
-OUTPUT
-
-pir_error_output_like( << 'CODE', << 'OUTPUT', "hcf" );
-.loadlib "myops_ops"
-.sub main :main
-    print "neither here\n"
-    hcf
-    print "nor there\n"
-.end
-CODE
-/neither here
-(?!nor there)/
-OUTPUT
-
-{
-    my @todo;
-
-    if ( $ENV{TEST_PROG_ARGS} ) {
-        @todo = ( todo => 'broken with JIT' ) if $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/;
-    }
-
-    my $quine = <<'END_PASM';
-.loadlib "myops_ops"
-q
-END_PASM
-    pasm_output_is( $quine, $quine, 'a short cheating quine', @todo );
-}
-
-    my @todo = $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ ?
-       ( todo => 'RT #49718, add scheduler features to JIT' ) : ();
-
-pir_output_is( << 'CODE', << 'OUTPUT', "one alarm", @todo );
-.loadlib "myops_ops"
-
-.sub main :main
-    get_global $P0, "_alarm"
-    alarm 0.1, $P0
-    print "1\n"
-
-    # alarm should be triggered half-way
-    # during this sleep
-    sleep 1
-    sleep 1
-    print "2\n"
-
-    sleep 1
-    print "3\n"
-    print "done.\n"
-.end
-
-.sub _alarm
-    print "alarm\n"
-.end
-CODE
-1
-alarm
-2
-3
-done.
-OUTPUT
-
-SKIP: {
-    skip "three alarms, infinite loop under mingw32", 2 if $is_mingw;
-    skip "dynops weird in CGP with events", 2 if $ENV{TEST_PROG_ARGS} =~ /--runcore=cgoto/;
-
-    my @todo = $ENV{TEST_PROG_ARGS} =~ /--runcore=jit/ ?
-       ( todo => 'RT #49718, add scheduler features to JIT' ) : ();
-
-    pir_output_like( << 'CODE', << 'OUTPUT', "three alarm", @todo );
-
-.loadlib "myops_ops"
-.sub main :main
-    $P1 = new 'Integer'
-    set $P1, 0
-    set_global "flag", $P1
-    get_global $P0, "_alarm3"
-    alarm 0.3, $P0
-    get_global $P0, "_alarm2"
-    alarm 0.2, $P0
-    get_global $P0, "_alarm1"
-    alarm 0.1, $P0
-
-    set $I0, 1
-loop:
-    sleep 0.1
-    inc $I0
-    # check_events
-    get_global $P1, "flag"
-    ge $P1, 7, done
-    le $I0, 40, loop
-
-done:
-    get_global $P1, "flag"
-    $I1 = $P1
-    print $I1
-    print "\n"
-.end
-
-.sub _alarm1
-    get_global $P0, "flag"
-    add $P0, 1
-    set_global "flag", $P0
-.end
-
-.sub _alarm2
-    get_global $P0, "flag"
-    add $P0, 2
-    set_global "flag", $P0
-.end
-
-.sub _alarm3
-    get_global $P0, "flag"
-    add $P0, 4
-    set_global "flag", $P0
-.end
-
-CODE
-/7/
-OUTPUT
-
-    pir_output_like( << 'CODE', << 'OUTPUT', "repeating alarm", @todo );
-
-.loadlib "myops_ops"
-.sub main :main
-    get_global $P0, "_alarm"
-    alarm 0.5, 0.4, $P0
-    set $I0, 1
-loop:
-    sleep 1
-    inc $I0
-    # check_events
-    le $I0, 4, loop
-.end
-
-.sub _alarm
-    print "alarm\n"
-.end
-
-CODE
-/alarm
-alarm
-alarm/
-OUTPUT
-}
-
-# bxand boolean op
-pasm_output_is( <<'CODE', <<'OUTPUT', 'bxand - A AND B, but not BOTH' );
-.loadlib "myops_ops"
-
-    bxand I0, 0, 0
-    bsr test
-    bxand I0, 0, 1
-    bsr test
-    bxand I0, 1, 0
-    bsr test
-    bxand I0, 1, 1
-    bsr test
-
-    branch end
-  test:
-    eq I0, 1, T
-    print "F\n"
-    ret
-  T:print "T\n"
-    ret
-  end:
-    end
-CODE
-F
-F
-F
-F
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "conv_u2_i" );
-
-.loadlib "myops_ops"
-
-    set I0, 32767
-    conv_u2 I0
-    print I0
-    print "\n"
-    inc I0
-    conv_u2 I0
-    print I0
-    print "\n"
-    set I0, 65535
-    conv_u2 I0
-    print I0
-    print "\n"
-    inc I0
-    conv_u2 I0
-    print I0
-    print "\n"
-    dec I0
-    conv_u2 I0
-    print I0
-    print "\n"
-    end
-CODE
-32767
-32768
-65535
-0
-65535
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "conv_i2_i" );
-
-.loadlib "myops_ops"
-
-    set I0, 32767       # 2 ^ 15 -1
-    conv_i2 I0
-    print I0
-    print "\n"
-    inc I0              # 2 ^ 15
-    conv_i2 I0
-    print I0
-    print "\n"
-    set I0, 65535       # 2 ^ 16 -1
-    conv_i2 I0
-    print I0
-    print "\n"
-    inc I0              # -1 + 1
-    conv_i2 I0
-    print I0
-    print "\n"
-    dec I0              # 0 - 1
-    conv_i2 I0
-    print I0
-    print "\n"
-    end
-CODE
-32767
--32768
--1
-0
--1
-OUTPUT
-
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list