Skip to content
Browse files

Sync branch with trunk

git-svn-id: https://svn.parrot.org/parrot/branches/orderedhash_revamp@43585 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
1 parent f51c324 commit 3a42b9d49ccd5a8a17506aa1470cdf9383ef81d2 bacek committed Jan 25, 2010
View
4 ChangeLog
@@ -1,5 +1,9 @@
#1 $Id$
+2010.01.19 chromatic
+ * Released 2.0.0
+ See NEWS for more.
+
2009.12.15 Gerd
* Released 1.9.0
See NEWS for more.
View
7 MANIFEST
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 13 12:09:32 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 20 03:18:02 2010 UT
#
# See below for documentation on the format of this file.
#
@@ -201,8 +201,6 @@ compilers/tge/TGE/Parser.pg [tge]
compilers/tge/TGE/Rule.pir [tge]
compilers/tge/TGE/Tree.pir [tge]
compilers/tge/tgc.pir [tge]
-config/auto/alignptrs.pm []
-config/auto/alignptrs/test_c.in []
config/auto/arch.pm []
config/auto/attributes.pm []
config/auto/attributes/test_c.in []
@@ -1838,6 +1836,7 @@ t/op/sysinfo.t [test]
t/op/time.t [test]
t/op/time_old.t [test]
t/op/trans.t [test]
+t/op/trans_old.t [test]
t/op/vivify.t [test]
t/perl/Parrot_Distribution.t [test]
t/perl/Parrot_Docs.t [test]
@@ -1973,8 +1972,6 @@ t/src/embed.t [test]
t/src/exit.t [test]
t/src/extend.t [test]
t/src/warnings.t [test]
-t/steps/auto/alignptrs-01.t [test]
-t/steps/auto/alignptrs-02.t [test]
t/steps/auto/arch-01.t [test]
t/steps/auto/attributes-01.t [test]
t/steps/auto/backtrace-01.t [test]
View
4 MANIFEST.generated
@@ -2,10 +2,10 @@
# See tools/dev/install_files.pl for documentation on the
# format of this file.
# Please re-sort this file after *EVERY* modification
-blib/lib/libparrot.1.9.0.dylib [main]lib
+blib/lib/libparrot.2.0.0.dylib [main]lib
blib/lib/libparrot.a [main]lib
blib/lib/libparrot.dylib [main]lib
-blib/lib/libparrot.so.1.9.0 [main]lib
+blib/lib/libparrot.so.2.0.0 [main]lib
blib/lib/libparrot.so [main]lib
compilers/data_json/data_json.pbc [data_json]
compilers/json/JSON.pbc [json]
View
2 META.yml
@@ -4,7 +4,7 @@
# See http://module-build.sourceforge.net/META-spec-current.html for details.
---
name: parrot
-version: 1.9.0
+version: 2.0.0
author: parrot-dev@lists.parrot.org
abstract: a virtual machine designed for dynamic languages
license: artistic2
View
9 NEWS
@@ -1,27 +1,22 @@
# $Id$
New in 2.0.0
-- Functionality
+- Features
+ Context PMCs now support attribute-based introspection
+ Context and CallSignature PMCs merged into CallContext
+ .lex directive throws exceptions when used with incorrect register types
-- Compilers
- + PIRC (new PIR compiler) built by default
- Platforms
+ Packaging improved for free OS distributions
+ PPC, PPC64, and ARM now tested when running Linux
- Performance
+ Minor improvements to the profiling runcore
- + Modest improvements from the CallContext PMC merge
+ + Improvements from the CallContext PMC merge
- New deprecations
+ In/out parameters in STRING modification functions
+ Void handling in NCI signatures
+ Parameter passing opcodes order in PBC
-- Realized deprecations
- Tests
+ Continued migration of core tests from Perl 5 to PIR
-- Documentation
- + Improved accuracy, removed typos
- Tools
+ dependency checker improved
- Miscellaneous
View
7 PBC_COMPAT
@@ -27,12 +27,7 @@
# please insert tab separated entries at the top of the list
-5.6 2009.12.12 bacek merge CallSignature and Context
-5.5 2010.01.01 plobsing change prophash handling
-5.4 2009.12.02 bacek remove CallSignatureReturns
-5.3 2009.10.23 bacek add CallSignatureReturns
-5.2 2009.09.16 darbelo remove pic.ops
-5.2 2009.08.06 dukeleto remove Random PMC
+6.0 2010.01.19 chromatic released 2.0.0
5.1 2009.08.06 cotto remove branch_cs opcode
5.0 2009.07.21 cotto released 1.4.0
4.0 2009.03.17 allison released 1.0.0
View
29 README
@@ -1,7 +1,7 @@
-This is Parrot, version 1.9.0
+This is Parrot, version 2.0.0
------------------------------
-Parrot is Copyright (C) 2001-2009, Parrot Foundation.
+Parrot is Copyright (C) 2001-2010, Parrot Foundation.
$Id$
@@ -16,15 +16,15 @@ PREREQUISITES
You need a C compiler, a linker, and a make program of course.
-If you will be linking with the ICU library you have to download and install it before
-configuring Parrot. Get it from http://site.icu-project.org/download
+If you will be linking with the ICU library you have to download and install it
+before configuring Parrot. Get it from http://site.icu-project.org/download
You also need Perl 5.8.4 or newer, and Storable 2.12 or newer
for running various configure and build scripts.
For most of the platforms that we are supporting initially, Parrot should build
-out of the box. docs/parrot.pod lists the core platforms.
-PLATFORMS provides reports on the platforms on which Parrot has been built and tested.
+out of the box. docs/parrot.pod lists the core platforms. PLATFORMS provides
+reports on the platforms on which Parrot has been built and tested.
INSTRUCTIONS
------------
@@ -85,13 +85,6 @@ By default, this installs in /usr/local, with the Parrot executable in
But please note that dynamic libs will not be found for non-standard
locations unless you set LD_LIBRARY_PATH or similar.
-If you want to build high level languages on top of Parrot, you should
-also run
-
- make install-dev
-
-to install development files which compilers need in their build process.
-
Look at docs/parrot.pod and docs/intro.pod for where to go from here. If you
have any problems, see the section "How To Submit A Bug Report" in
docs/submissions.pod. These documents are in POD format. You can view these
@@ -116,14 +109,16 @@ previous versions, please see NEWS.
MAILING LISTS
-------------
-The mailing list for Parrot is parrot-dev@lists.parrot.org. Subscribe by
-filling out the form at http://lists.parrot.org/mailman/listinfo/parrot-dev
-It is archived at http://lists.parrot.org/pipermail/parrot-dev/
+The Parrot user mailing list is parrot-users@lists.parrot.org. Subscribe by
+filling out the form at http://lists.parrot.org/mailman/listinfo/parrot-users .
+The list is archived at http://lists.parrot.org/pipermail/parrot-users/ .
+
+For development discussions see the information in docs/gettingstarted.pod.
FEEDBACK, PATCHES, etc.
-----------------------
-See F<docs/submissions.pod> for more information on reporting bugs and
+See docs/submissions.pod for more information on reporting bugs and
submitting patches.
WEB SITES
View
2 VERSION
@@ -1 +1 @@
-1.9.0
+2.0.0
View
28 compilers/imcc/imcc.l
@@ -718,21 +718,33 @@ SP [ ]
}
<macro>".$"{ID} {
- if (valp) {
- const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name) + yyleng + 12;
- char * const label = (char *)mem_sys_allocate(len);
+ if (valp) {
+ if (!IMCC_INFO(interp)->cur_macro_name) {
+ if (valp->s)
+ mem_sys_free(valp->s);
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+ "Invalid LABEL outside of macro");
+ }
+ else {
+ char * const fmt = "local__%s__%s__$";
+ const size_t fmtlen = strlen(fmt) - (2 * strlen("%s"));
+ const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name)
+ + yyleng + fmtlen;
+ char * const label = (char *)mem_sys_allocate(len);
- snprintf(label, len, "local__%s__%s__$",
- IMCC_INFO(interp)->cur_macro_name, yytext+2);
+ /* skip over ".$" prefix with the +2 */
+ snprintf(label, len, fmt,
+ IMCC_INFO(interp)->cur_macro_name, yytext + 2);
if (valp->s)
mem_sys_free(valp->s);
valp->s = label;
}
-
- return IDENTIFIER;
}
+ return IDENTIFIER;
+}
+
<macro>^{WS}+ /* skip leading ws */;
<macro>{WS}+ DUP_AND_RET(valp, ' ');
<macro>[SNIP]{DIGITS} DUP_AND_RET(valp, REG);
@@ -1139,7 +1151,7 @@ expand_macro(PARROT_INTERP, ARGIN(const char *name), void *yyscanner)
m = find_macro(interp, name);
if (m) {
- int i,c,start_cond;
+ int i, c, start_cond;
macro_frame_t * frame = new_frame(interp);
frame->params = &m->params;
View
49 compilers/imcc/imclexer.c
@@ -3901,66 +3901,77 @@ case 140:
YY_RULE_SETUP
#line 720 "compilers/imcc/imcc.l"
{
- if (valp) {
- const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name) + yyleng + 12;
- char * const label = (char *)mem_sys_allocate(len);
+ if (valp) {
+ if (!IMCC_INFO(interp)->cur_macro_name) {
+ if (valp->s)
+ mem_sys_free(valp->s);
+ IMCC_fataly(interp, EXCEPTION_SYNTAX_ERROR,
+ "Invalid LABEL outside of macro");
+ }
+ else {
+ char * const fmt = "local__%s__%s__$";
+ const size_t fmtlen = strlen(fmt) - ( 2 * strlen("%s") );
+ const size_t len = strlen(IMCC_INFO(interp)->cur_macro_name)
+ + yyleng + fmtlen;
+ char * const label = (char *)mem_sys_allocate(len);
- snprintf(label, len, "local__%s__%s__$",
- IMCC_INFO(interp)->cur_macro_name, yytext+2);
+ snprintf(label, len, fmt,
+ IMCC_INFO(interp)->cur_macro_name, yytext + 2);
if (valp->s)
mem_sys_free(valp->s);
valp->s = label;
}
-
- return IDENTIFIER;
}
+
+ return IDENTIFIER;
+}
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 736 "compilers/imcc/imcc.l"
+#line 747 "compilers/imcc/imcc.l"
/* skip leading ws */;
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 737 "compilers/imcc/imcc.l"
+#line 748 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, ' ');
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 738 "compilers/imcc/imcc.l"
+#line 749 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, REG);
YY_BREAK
case 144:
YY_RULE_SETUP
-#line 739 "compilers/imcc/imcc.l"
+#line 750 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, REG);
YY_BREAK
case 145:
YY_RULE_SETUP
-#line 740 "compilers/imcc/imcc.l"
+#line 751 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, IDENTIFIER);
YY_BREAK
case 146:
YY_RULE_SETUP
-#line 741 "compilers/imcc/imcc.l"
+#line 752 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, MACRO);
YY_BREAK
case 147:
YY_RULE_SETUP
-#line 742 "compilers/imcc/imcc.l"
+#line 753 "compilers/imcc/imcc.l"
DUP_AND_RET(valp, yytext[0]);
YY_BREAK
case YY_STATE_EOF(macro):
-#line 743 "compilers/imcc/imcc.l"
+#line 754 "compilers/imcc/imcc.l"
yyterminate();
YY_BREAK
case 148:
YY_RULE_SETUP
-#line 745 "compilers/imcc/imcc.l"
+#line 756 "compilers/imcc/imcc.l"
ECHO;
YY_BREAK
-#line 3964 "compilers/imcc/imclexer.c"
+#line 3975 "compilers/imcc/imclexer.c"
case YY_STATE_EOF(pod):
case YY_STATE_EOF(cmt1):
case YY_STATE_EOF(cmt2):
@@ -5162,7 +5173,7 @@ void yyfree (void * ptr , yyscan_t yyscanner)
#define YYTABLES_NAME "yytables"
-#line 745 "compilers/imcc/imcc.l"
+#line 756 "compilers/imcc/imcc.l"
@@ -5561,7 +5572,7 @@ expand_macro(PARROT_INTERP, ARGIN(const char *name), void *yyscanner)
m = find_macro(interp, name);
if (m) {
- int i,c,start_cond;
+ int i, c, start_cond;
macro_frame_t * frame = new_frame(interp);
frame->params = &m->params;
View
4 compilers/pirc/src/bcgen.c
@@ -846,7 +846,7 @@ generate_multi_signature(ARGIN(bytecode * const bc),
/*
-=item C<int emit_pbc_key(bytecode * const bc, key * const k)>
+=item C<int emit_pbc_key(bytecode * const bc, struct key * const k)>
Emit bytecode for the key C<k>. First the bytecode is
written to a temporary buffer, which is later unpacked
@@ -856,7 +856,7 @@ in the actual PackFile. See C<store_key_bytecode()>.
*/
int
-emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(key * const k))
+emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(struct key * const k))
{
ASSERT_ARGS(emit_pbc_key)
key_entry *iter;
View
6 compilers/pirc/src/bcgen.h
@@ -162,6 +162,10 @@ opcode_t /*@alt void@*/
emit_opcode(ARGIN(bytecode * const bc), opcode_t op)
__attribute__nonnull__(1);
+int emit_pbc_key(ARGIN(bytecode * const bc), ARGIN(struct key * const k))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
FLOATVAL get_num_const(ARGIN(bytecode * const bc), unsigned index)
__attribute__nonnull__(1);
@@ -285,8 +289,6 @@ FLOATVAL get_num_const(bytecode * const bc, unsigned index);
STRING *get_string_const(bytecode * const bc, unsigned index);
-int emit_pbc_key(bytecode * const bc, struct key * const k);
-
/*
int add_string_const(bytecode * const bc, STRING *s);
View
110 config/auto/alignptrs.pm
@@ -1,110 +0,0 @@
-# Copyright (C) 2001-2005, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-config/auto/alignptrs.pm - pointer alignment
-
-=head1 DESCRIPTION
-
-Determine the minimum pointer alignment.
-
-=cut
-
-package auto::alignptrs;
-
-use strict;
-use warnings;
-
-use base qw(Parrot::Configure::Step);
-
-use Parrot::Configure::Utils ':auto';
-
-sub _init {
- my $self = shift;
- my %data;
- $data{description} = q{Determine your minimum pointer alignment};
- $data{result} = q{};
- return \%data;
-}
-
-sub runstep {
- my ( $self, $conf ) = ( shift, shift );
-
- my $result_str = '';
- my $align;
- if ( defined( $conf->data->get('ptr_alignment') ) ) {
- $align = $conf->data->get('ptr_alignment');
- $result_str .= "configured: ";
- }
- elsif ( $conf->data->get('OSNAME_provisional') eq 'hpux'
- && $conf->data->get('ccflags_provisional') !~ /DD64/ ) {
-
- # HP-UX 10.20/32 hangs in this test.
- $align = 4;
- $conf->data->set( ptr_alignment => $align );
- $result_str .= "for hpux: ";
- }
- else {
-
- # Now really test by compiling some code
- $conf->cc_gen('config/auto/alignptrs/test_c.in');
- $conf->cc_build();
- my $minimum_valid_align;
- my @aligns = (1, 2, 4, 8, 16, 32, 64);
- TRY_ALIGN: while ( defined( my $try_align = shift(@aligns) ) ) {
- my $results = $conf->cc_run_capture($try_align);
- $align = _evaluate_results($results, $try_align);
- if (defined $align) {
- $minimum_valid_align = $align;
- last TRY_ALIGN;
- }
- else {
- next TRY_ALIGN;
- }
- }
- $conf->cc_clean();
-
- _evaluate_ptr_alignment($conf, $minimum_valid_align);
-
- # If at this point we haven't died, then we can assign
- # $minimum_valid_align to $align.
- $align = $minimum_valid_align;
- }
-
- $self->_finalize_result_str($align, $result_str);
-
- return 1;
-}
-
-sub _evaluate_results {
- my ($results, $try_align) = @_;
- my $align;
- if ( $results =~ /OK/ && $results !~ /align/i ) {
- $align = $try_align;
- }
- return $align;
-}
-
-sub _evaluate_ptr_alignment {
- my ($conf, $minimum_valid_align) = @_;
- die "Can't determine alignment!\n" unless defined $minimum_valid_align;
- $conf->data->set( ptr_alignment => $minimum_valid_align );
-}
-
-sub _finalize_result_str {
- my $self = shift;
- my ($align, $result_str) = @_;
- $result_str .= " $align byte";
- $result_str .= "s" unless $align == 1;
- $self->set_result($result_str);
-}
-
-1;
-
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
63 config/auto/alignptrs/test_c.in
@@ -1,63 +0,0 @@
-/*
-Copyright (C) 2002-2009, Parrot Foundation.
-$Id$
-
-figure out our minimum pointer alignment
-*/
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <signal.h>
-/* Try to catch bus errors */
-#ifdef SIGBUS
-# include <stdlib.h>
-void bletch(int s) { exit(1); }
-#endif
-
-int
-main(int argc, char **argv)
-{
- int i;
- char *c;
-
- long space[32];
- void **ptr;
-
- int align = 0;
-
- if (argc != 2) {
- printf("FAILED - single command-line parameter required!\n");
- return 1;
- }
-
-#ifdef SIGBUS
- signal(SIGBUS, bletch);
-#endif
-
- for (i = 0; i < 32; i ++) space[i] = 0;
-
- for (c = argv[1]; *c; c++) align = align * 10 + ((int)*c - '0');
-
-#if defined(__alpha)
- if (align < 8) {
- printf("Soft failure hack for systems that simulate unaligned access\n");
- return 1;
- }
-#endif
-
- ptr = (void **)((char *)space + align);
-
- if (*ptr == (void *)0)
- printf("%d OK\n", align);
- else
- printf("%d OK but didnt equal zero\n", align);
-
- return 0;
-}
-
-/*
- * Local variables:
- * c-file-style: "parrot"
- * End:
- * vim: expandtab shiftwidth=4:
- */
View
1 config/gen/config_h/config_h.in
@@ -94,7 +94,6 @@ struct PackFile; typedef struct PackFile * Parrot_PackFile;
#define PARROT_OS_NAME "@jitosname@"
#define PARROT_BYTEORDER 0x@byteorder@
#define PARROT_BIGENDIAN @bigendian@
-#define PARROT_PTR_ALIGNMENT @ptr_alignment@
#define PARROT_LITTLEENDIAN !(PARROT_BIGENDIAN)
View
2 config/gen/config_pm/myconfig.in
@@ -17,5 +17,5 @@ Summary of my parrot @VERSION@ (r@revision@) configuration:
load_ext='@load_ext@', ld_load_flags='@ld_load_flags@'
Types:
iv=@iv@, intvalsize=@intvalsize@, intsize=@intsize@, opcode_t=@opcode_t@, opcode_t_size=@opcode_t_size@,
- ptrsize=@ptrsize@, ptr_alignment=@ptr_alignment@ byteorder=@byteorder@,
+ ptrsize=@ptrsize@, byteorder=@byteorder@,
nv=@nv@, numvalsize=@numvalsize@, doublesize=@doublesize@, longdoublesize=@hugefloatvalsize@
View
4 config/gen/makefiles/root.in
@@ -1887,9 +1887,7 @@ editor-clean :
#
###############################################################################
-# The --running-make-test argument is currently used by long-running tests
-# to disable GC_DEBUG.
-EXTRA_TEST_ARGS := --gc-debug --running-make-test
+EXTRA_TEST_ARGS := --gc-debug
DISTRO_TEST_FILES := \
t/distro/*.t
BENCHMARK_TEST_FILES := \
View
2 config/init/hints/openbsd.pm
@@ -37,7 +37,7 @@ sub runstep {
$conf->data->set( as => 'as -mregnames' );
}
- $conf->data->set( clock_best => '-DCLOCK_BEST=CLOCK_MONOTONIC' );
+ $conf->data->set( clock_best => '-D_POSIX_TIMERS -DCLOCK_BEST=CLOCK_MONOTONIC' );
}
1;
View
2 docs/intro.pod
@@ -145,7 +145,7 @@ Parrot has an extensive regression test suite. This can be run by typing:
Substituting make for the name of the make program on your platform. The output
will look something like this:
- C:\Perl\bin\perl.exe t\harness --gc-debug --running-make-test
+ C:\Perl\bin\perl.exe t\harness --gc-debug
t\library\*.t t\op\*.t t\pmc\*.t t\run\*.t t\native_pbc\*.t
imcc\t\*\*.t t\dynpmc\*.t t\p6rules\*.t t\src\*.t t\perl\*.t
t\library\dumper...............ok
View
2 docs/parrothist.pod
@@ -102,4 +102,6 @@ Starred release numbers indicate supported releases.
Barney 1.8.0 2009-Nov-17 "Zygodactyly"
Gerd 1.9.0 2009-Dec-15 "Blue-fronted Amazon"
+ chromatic 2.0.0 * 2010-Jan-19 "Inevitable"
+
=cut
View
11 docs/project/release_manager_guide.pod
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2009, Parrot Foundation.
+# Copyright (C) 2007-2010, Parrot Foundation.
# $Id$
=head1 Release Instructions
@@ -42,7 +42,7 @@ L<https://trac.parrot.org/parrot/wiki/Languages>.
On the Saturday before a release you should notify other developers to stop
committing non-release related code to trunk. This will help avoid
complications. They are of course free to commit to branches as much as
-they like. You might also set the topic in #parrot, announcing the
+they like. You might also set the topic in #parrot, announcing the
time when you plan on starting the release procedure. This will help
the committers with timing their last minute commits.
@@ -137,8 +137,10 @@ as these are only used in development and not relevant to the bytecode support
policy. (Those changes are all included within the major version number
increase for the supported release.)
-Once you've updated PBC_COMPAT, run C<tools/dev/mk_native_pbc> to update the
-pbc files used in the native pbc tests.
+Once you've updated PBC_COMPAT, run C<sh tools/dev/mk_native_pbc> to update the
+pbc files used in the native pbc tests. Note that you must have Parrot already
+built for this to work, and that this script will reconfigure and rebuild
+Parrot with various primitive size options.
=item h
@@ -391,7 +393,6 @@ The calendar of releases is available at the comp.lang.parrot google calendar,
visible at
L<http://www.google.com/calendar/render?cid=ldhctdamsgfg5a1cord52po9h8@group.calendar.google.com>.
- - Jan 19, 2010 - 2.0* - chromatic
- Feb 16, 2010 - 2.1 - darbelo
- Mar 16, 2010 - 2.2 - cotto
- Apr 20, 2010 - 2.3* - gerd
View
61 docs/submissions.pod
@@ -11,8 +11,8 @@ How to submit bug reports, patches and new files to Parrot.
=head1 How To Submit A Bug Report
-If you encounter an error while working with Parrot, and don't understand what
-is causing it, then create a bug report using the F<parrotbug> utility. The
+If you encounter an error while working with Parrot and don't understand what
+is causing it, create a bug report using the F<parrotbug> utility. The
simplest way to use it is to run
% ./parrotbug
@@ -22,18 +22,12 @@ in the distribution's root directory, and follow the prompts.
However, if you do know how to fix the problem you encountered, then think
about submitting a patch, or (see below) getting commit privileges.
-=head1 How To Submit A Patch
+=head1 How To Create A Patch
Try to keep your patches specific to a single change, and ensure that your
change does not break any tests. Do this by running C<make test>. If there is
no test for the fixed bug, please provide one.
-=over
-
-=item 1
-
-Create the patch.
-
In the following examples, F<parrot> contains the Parrot distribution, and
F<workingdir> contains F<parrot>. The name F<workingdir> is just a placeholder
for whatever the distribution's parent directory is called on your machine.
@@ -97,15 +91,25 @@ The format for entries in F<CREDITS> is defined at the top of the file.
=back
-=item 2
+=head1 How To Submit A Patch
+
+=over 4
+
+=item 1
Go to Parrot's ticket tracking system at
L<https://trac.parrot.org/parrot/>. Log in, or create an account if you
don't have one yet.
+=item 2
+
+If there is already a ticket for the bug or feature that your patch relates
+to, just attach the patch directly to the ticket.
+
=item 3
-Select "New Ticket" L<https://trac.parrot.org/parrot/newticket>.
+Otherwise select "New Ticket" at the top of the site.
+L<https://trac.parrot.org/parrot/newticket>
=item 4
@@ -129,9 +133,8 @@ the F<Patch status> drop-down box.
=item 7
-Check the box for "I have files to attach to this ticket"
-
-Double-check that you've actually done this, because it's easy to forget.
+Check the box for "I have files to attach to this ticket". Double-check
+that you've actually done this, because it's easy to forget.
B<DO NOT> paste the patch file content into the Description.
@@ -248,26 +251,22 @@ MANIFEST and your new file(s).
=head1 What Happens Next?
-Trac creates a ticket for the submission, and you will receive an automatic reply
-with details of the ticket identifier. This identifier should be used in all
-further correspondence concerning the submission.
+If you created a new ticket for the submission, you will be taken to the page
+for the new ticket and can check on the progress of your submission there.
+This identifier should be used in all correspondence concerning the submission.
-Everyone on the list sees the submission, and can comment on it. A developer
-with SVN commit authority will commit it to SVN once it is clear that it is the
+Everyone on Trac sees the submission and can comment on it. A developer with
+SVN commit authority can commit it to SVN once it is clear that it is the
right thing to do.
-Even developers with SVN commit authority stick to this scheme for larger or
-more complex changes, to allow time for peer review.
-
-You can check the progress of your submission at the Parrot bugs page
-L<http://bugs6.perl.org/>. If you have trouble logging in try username C<guest>
-with password C<guest>.
+However developers with SVN commit authority may not commit your changes
+immediately if they are large or complex, as we need time for peer review.
-A Parrot Bug Summary page is also available from
-L<https://rt.perl.org/rt3/NoAuth/parrot/Overview.html>
+A list of active tickets can be found here:
+L<http://trac.parrot.org/parrot/report/1>
-A list of all the unresolved patches is at
-L<http://www.parrotcode.org/openpatches.html>
+A list of all the unresolved patches is at:
+L<http://trac.parrot.org/parrot/report/15>
=head1 Patches for the Parrot website
@@ -303,8 +302,8 @@ L<http://www.parrot.org/files/parrot_cla.pdf>
=item 4
Request commit access via the C<parrot-dev> mailing list, or via IRC
-(#parrot on irc.parrot.org). The existing committers will discuss your request in
-the next couple of weeks.
+(#parrot on irc.parrot.org). The existing committers will discuss your
+request in the next couple of weeks.
If approved, a metacommitter will update the permissions to allow you to commit
to Parrot; see C<RESPONSIBLE_PARTIES> for the current list. Welcome aboard!
View
1 lib/Parrot/Configure/Step/List.pm
@@ -31,7 +31,6 @@ my @steps = qw(
inter::types
auto::ops
auto::pmc
- auto::alignptrs
auto::headers
auto::sizes
auto::byteorder
View
4 lib/Parrot/Harness/Options.pm
@@ -28,9 +28,6 @@ sub handle_long_options {
my @argv = @_;
my %longopts;
- $longopts{running_make_test} = grep { $_ eq '--running-make-test' } @argv;
- @argv = grep { $_ ne '--running-make-test' } @argv;
-
$longopts{gc_debug} = grep { $_ eq '--gc-debug' } @argv;
@argv = grep { $_ ne '--gc-debug' } @argv;
@@ -130,7 +127,6 @@ perl t/harness [options] [testfiles]
-r ... assemble to PBC run PBC
-O[012] ... optimize
-D[number] ... pass debug flags to parrot interpreter
- --running-make-test
--gc-debug
--core-tests
--runcore-tests
View
0 ports/fedora/parrot-1.x.0.patch → ports/fedora/parrot.patch
File renamed without changes.
View
104 ports/fedora/parrot.spec.fedora
@@ -1,18 +1,18 @@
Name: parrot
-Version: 1.4.0
-Release: 9%{?dist}
-Summary: Parrot is a virtual machine
+Version: 2.0.0
+Release: 1%{?dist}
+Summary: a virtual machine
License: Artistic 2.0
Group: Development/Libraries
URL: http://www.parrot.org/
Source0: ftp://ftp.parrot.org/pub/parrot/releases/stable/%{version}/parrot-%{version}.tar.gz
-Patch0: parrot-1.x.0.patch
-# patches file: tools/dev/install_files.pl
+Patch0: parrot.patch
+# patched file: tools/dev/install_files.pl
# It is responsible to have no subdirectory under pkgconfig.
#
-# patches file: config/gen/makefiles/parrot_pc.in
+# patched file: config/gen/makefiles/parrot_pc.in
# So "pkg-config parrot --cflags" works correct
#
# see for upstream: https://trac.parrot.org/parrot/ticket/509
@@ -32,6 +32,7 @@ BuildRequires: perl(Test::Simple)
BuildRequires: ctags
BuildRequires: openssl-devel
BuildRequires: flex
+BuildRequires: bison
%package docs
@@ -92,8 +93,6 @@ Parrot Virtual Machine development files for building languages.
%setup -q
%patch0 -p0
-%{__perl} -pi -e "s,'/usr/lib','%{_libdir}'," tools/dev/install_files.pl
-
cat << \EOF > %{name}-prov
#!/bin/sh
@@ -125,11 +124,9 @@ chmod +x %{__perl_provides}
--optimize="$RPM_OPT_FLAGS" \
--parrot_is_shared \
--disable-rpath \
- --lex=%{_bindir}/flex \
- --yacc=%{_bindir}/yacc \
- --libs='-lcurses -lm'
+ --lex=%{_bindir}/flex
-# The LDD_LIBRARY_PATH hack is needed for "miniparrot"
+# The LD_LIBRARY_PATH hack is needed for "miniparrot"
# to find his parrot-library in "blib/lib"
export LD_LIBRARY_PATH=$( pwd )/blib/lib
@@ -143,14 +140,26 @@ make html
%install
rm -rf $RPM_BUILD_ROOT
-# This hack is needed for "miniparrot" to find his parrot-library in "blib/lib"
+# The LD_LIBRARY_PATH hack is needed for the command "pbc_to_exe parrot-nqp.pbc"
+# to find his parrot-library in "blib/lib"
export LD_LIBRARY_PATH=$( pwd )/blib/lib
-# install-dev: Same as 'install' taget but also install support for development.
+# install-dev: Same as 'install' taget but also install support for
+# language development
make install-dev DESTDIR=$RPM_BUILD_ROOT
-%define RPM_PAR_LIB_DIR $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/
-
+# Creating man-pages
+%{__install} -d $RPM_BUILD_ROOT%{_mandir}/man1
+for var in 'parrot docs/running.pod' 'parrot_debugger src/parrot_debugger.c' \
+ 'pbc_disassemble src/pbc_disassemble.c' 'pbc_dump src/pbc_dump.c' \
+ 'pbc_merge src/pbc_merge.c' 'pbc_to_exe tools/dev/pbc_to_exe.pir' \
+ 'parrot_config tools/build/parrot_config_c.pl' \
+ 'parrot-nqp compilers/nqp/README.pod'
+do
+ MAN_NAME=`echo $var | %{__perl} -na -e 'print $F[0]'`
+ MAN_SOURCE=`echo $var | %{__perl} -na -e 'print $F[1]'`
+ pod2man --section=1 --name=$MAN_NAME $MAN_SOURCE | %{__gzip} -c > $RPM_BUILD_ROOT%{_mandir}/man1/${MAN_NAME}.1.gz
+done
# Drop the docs so rpm can pick them up itself.
rm -rf $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}
@@ -159,6 +168,10 @@ rm -rf $RPM_BUILD_ROOT%{_defaultdocdir}/%{name}
find docs examples -type d -exec chmod 755 {} \;
find docs examples -type f -exec chmod 644 {} \;
+
+%define RPM_PAR_LIB_DIR $RPM_BUILD_ROOT%{_libdir}/%{name}/%{version}/
+
+
# Force permissions on shared versioned libs so they get stripped.
# The parrot-install-script don't set the permissions right
# With changed permissions the dependencies will be found
@@ -180,22 +193,24 @@ find %{RPM_PAR_LIB_DIR}tools/dev -type f -name "pbc_to_exe.pir" \
# Remove doc-files with zero-length
find docs/html -type f -size 0 -exec rm -f {} \;
+find docs -wholename 'docs/doc-prep' -type f -size 0 -exec rm -f {} \;
# Set path for installed programs in docs package
find examples/json -type f -name "*.pir" \
-exec %{__sed} -i -e '1 s&#!../../parrot&#!/usr/bin/parrot&' {} \;
-find examples -type f -name "*.pl" \
- -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
-find examples -wholename 'examples/pir/befunge/t/basic.t' \
+find examples -type f -path 'examples/*/*/setup.pir' \
+ -exec %{__sed} -i -e '1 s&#! ../../../parrot&#!/usr/bin/parrot&' {} \;
+find examples -type f \( -name '*.pl' -o \
+ -wholename 'examples/pir/befunge/t/basic.t' -o \
+ -path 'examples/languages/*/harness' \) \
-exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
find examples -type f -name "*.py" \
-exec %{__sed} -i -e '1 s&#! python&#!/usr/bin/python&' {} \;
find examples -type f -name "*.rb" \
-exec %{__sed} -i -e '1 s&#! ruby&#!/usr/bin/ruby&' {} \;
-find examples -type f -name "*.pir" \
- -exec %{__sed} -i -e '1 s&#!./parrot&#!/usr/bin/parrot&' {} \;
-find examples/shootout -type f -name "random.pasm" \
+find examples -type f \( -name "*.pir" -o \
+ -wholename 'examples/shootout/random.pasm' \) \
-exec %{__sed} -i -e '1 s&#!./parrot&#!/usr/bin/parrot&' {} \;
find examples -wholename 'examples/languages/abc/t/01-tests.t' \
@@ -206,15 +221,6 @@ find examples -wholename 'examples/shootout/revcomp.pir' \
find examples -wholename 'examples/languages/abc/t/harness' \
-exec %{__perl} -pi -e 's/\r$//' {} \;
-find examples/languages -type f -name harness \
- -exec %{__sed} -i -e '1 s&#! perl&#!/usr/bin/perl&' {} \;
-for file in docs/book/draft/ch05_pge.pod docs/memory_internals.pod; do
- %{__mv} $file timestamp
- iconv -f ISO-8859-1 -t UTF-8 -o $file timestamp
- touch -r timestamp $file
-done
-%{__rm} -f timestamp
-
%check
# 'make fulltest' is done by default; it take a lot of time
@@ -240,6 +246,7 @@ rm -rf $RPM_BUILD_ROOT
%exclude %{_libdir}/parrot/%{version}/tools
%exclude %{_libdir}/parrot/%{version}/VERSION
%{_libdir}/libparrot.so.*
+%{_mandir}/man1/parrot.1.gz
%files docs
%defattr(-,root,root,-)
@@ -249,15 +256,22 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root,-)
%{_bindir}/parrot_config
%{_bindir}/parrot_debugger
+%{_bindir}/parrot-nqp
%{_bindir}/pbc_disassemble
-%{_bindir}/pbc_info
%{_bindir}/pbc_merge
%{_bindir}/pbc_to_exe
%{_bindir}/pbc_dump
%{_includedir}/parrot
%{_libdir}/libparrot.so
%exclude %{_libdir}/libparrot.a
%{_libdir}/pkgconfig/*
+%{_mandir}/man1/parrot_config.1.gz
+%{_mandir}/man1/parrot_debugger.1.gz
+%{_mandir}/man1/pbc_disassemble.1.gz
+%{_mandir}/man1/pbc_merge.1.gz
+%{_mandir}/man1/pbc_to_exe.1.gz
+%{_mandir}/man1/pbc_dump.1.gz
+%{_mandir}/man1/parrot-nqp.1.gz
%files tools
%defattr(-,root,root,-)
@@ -268,16 +282,20 @@ rm -rf $RPM_BUILD_ROOT
%changelog
-* Sat Aug 1 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.4.0-9
-- ppc test included again
-- include the necessary module Parrot::Oplib::core
-- change the place of header files to /usr/include/parrrot/<version>
-- install the files /usr/src/parrot/*
+* Wed Jan 20 2010 Gerd Pokorra <gp@zimt.uni-siegen.de> 2.0.0-1
+- new upstream version
+- add the parrot-nqp binary, with generating of the man-page
-* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.0-4
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
+* Sat Aug 22 2009 Tomas Mraz <tmraz@redhat.com> 1.5.0-2
+- rebuilt with new openssl
-* Tue Jul 21 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.4.0-1
+* Fri Aug 21 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.5.0-1
+- add man pages
+
+* Sat Aug 1 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.4.0-9
+- include the necessary module Parrot::OpLib::core
+- change the place of header files to /usr/include/parrot/<version>
+- install the files /usr/src/parrot/*
- add the new disable-rpath configure option
* Wed Mar 25 2009 Gerd Pokorra <gp@zimt.uni-siegen.de> 1.0.0-6
@@ -308,16 +326,12 @@ rm -rf $RPM_BUILD_ROOT
- updated to 1.0.0
* Tue Jan 23 2009 Reini Urban <rurban@x-ray.at> 0.9.0
-- added make installable, perl6 is still not installable
+- added make installable
- added parrot_utils to devel
-- fixed Source0 url
* Tue Dec 16 2008 Whiteknight <wknight8111@gmail.com> 0.8.2
- updated to 0.8.2
-* Tue Mar 18 2008 Bernhard Schmalhofer <Bernhard.Schmalhofer@gmx.de> 0.6.0
-- Update to 0.5.3.
-
* Wed Feb 20 2008 Patrick Michaud <pmichaud@pobox.com> 0.5.3
- Update to 0.5.3.
View
16 runtime/parrot/library/Getopt/Obj.pir
@@ -71,22 +71,22 @@ the attributes they'll use.
.sub __load :anon :load
.local pmc obj, spec, pns, ns
- obj = newclass "Getopt::Obj"
+ obj = newclass ['Getopt';'Obj']
addattribute obj, "Specs"
addattribute obj, "notOptStop"
- spec = newclass "Getopt::Obj::Spec"
+ spec = newclass ['Getopt';'Obj';'Spec']
addattribute spec, "name"
addattribute spec, "long"
addattribute spec, "short"
addattribute spec, "type"
addattribute spec, "optarg"
- ns = get_hll_namespace ["Getopt::Obj"]
+ ns = get_hll_namespace ['Getopt';'Obj']
$P0 = get_hll_namespace
pns = $P0.'make_namespace'('Getopt')
pns.'add_namespace'('Obj', ns)
- ns = get_hll_namespace ["Getopt::Obj::Spec"]
+ ns = get_hll_namespace ['Getopt';'Obj';'Spec']
pns = get_hll_namespace ['Getopt';'Obj']
pns.'add_namespace'('Spec', ns)
.end
@@ -101,7 +101,7 @@ Our nice little module.
=cut
-.namespace ["Getopt::Obj"]
+.namespace ['Getopt';'Obj']
=item C<init()>
@@ -462,7 +462,7 @@ Adds a new option to the parsing. You don't need to know what class it is
.sub "add" :method
.local pmc spec, specs
- spec = new "Getopt::Obj::Spec"
+ spec = new ['Getopt';'Obj';'Spec']
specs = getattribute self, "Specs"
push specs, spec
.return(spec)
@@ -568,14 +568,14 @@ When a required argument is missing, throws an exception with the message
=head2 Class Getopt::Obj::Spec
-Internal use only, at least don't do any new "Getopt::Obj::Spec" yourself...
+Internal use only, at least don't do any C<new ['Getopt';'Obj';'Spec'> yourself...
This makes an easy holder for each possible match.
=over 4
=cut
-.namespace ["Getopt::Obj::Spec"]
+.namespace ['Getopt';'Obj';'Spec']
=item C<init()>
View
2 src/pmc/unmanagedstruct.pmc
@@ -186,7 +186,6 @@ char_offset_key(PARROT_INTERP, PMC *pmc, PMC *key, int *type)
/* now point ptr to the real data */
if (*type == enum_type_struct_ptr) {
/* that is either a pointer */
- PARROT_ASSERT((PTR2INTVAL(p) & (PARROT_PTR_ALIGNMENT - 1)) == 0);
VTABLE_set_pointer(interp, init, *(void**)p);
}
@@ -200,7 +199,6 @@ char_offset_key(PARROT_INTERP, PMC *pmc, PMC *key, int *type)
* p is the location of the struct pointer in the
* outer struct, the inner is at PMC_data(init) */
- PARROT_ASSERT((PTR2INTVAL(p) & (PARROT_PTR_ALIGNMENT - 1)) == 0);
*(void **)p = VTABLE_get_pointer(interp, init);
}
View
12 src/pmc_freeze.c
@@ -548,9 +548,15 @@ visit_info_init(PARROT_INTERP, ARGOUT(visit_info *info),
/* we must use PMCs here so that they get marked properly */
info->todo = pmc_new(interp, enum_class_Array);
- info->seen = pmc_new(interp, enum_class_Hash);
- VTABLE_set_pointer(interp, info->seen, parrot_new_intval_hash(interp));
- info->id_list = pmc_new(interp, enum_class_Array);
+ if (info->what == VISIT_FREEZE_NORMAL) {
+ info->seen = pmc_new(interp, enum_class_Hash);
+ VTABLE_set_pointer(interp, info->seen, parrot_new_intval_hash(interp));
+ info->id_list = PMCNULL;
+ }
+ else {
+ info->seen = PMCNULL;
+ info->id_list = pmc_new(interp, enum_class_Array);
+ }
info->id = 0;
info->extra_flags = EXTRA_IS_NULL;
View
25 t/compilers/imcc/syn/macro.t
@@ -1,5 +1,5 @@
#!perl
-# Copyright (C) 2001-2009, Parrot Foundation.
+# Copyright (C) 2001-2010, Parrot Foundation.
# $Id$
use strict;
@@ -8,7 +8,7 @@ use lib qw( . lib ../lib ../../lib );
use Test::More;
use Parrot::Config;
-use Parrot::Test tests => 41;
+use Parrot::Test tests => 42;
# macro tests
@@ -585,6 +585,27 @@ leaving macro create_inst
my_func_2 my_func_2
OUTPUT
+pir_error_output_like( <<'CODE', <<'OUTPUT', 'macro label outside of macro declaration (TT #902)' );
+.macro While(conditional, code)
+
+.label $beginwhile:
+ unless .conditional goto .$endwhile
+ .code
+ goto .$beginwhile
+.label $endwhile:
+.endm
+
+.sub main
+.While($I0 < 3, {
+say $I0
+goto .$endwhile
+inc $I0
+})
+.end
+CODE
+/Invalid LABEL outside of macro/
+OUTPUT
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
View
6 t/harness
@@ -31,8 +31,6 @@ use Parrot::Harness::Smoke qw(
local @ARGV = @ARGV;
(my $longopts, @ARGV) = handle_long_options(@ARGV);
-$ENV{RUNNING_MAKE_TEST} = $longopts->{running_make_test};
-
# Suck the short options into the TEST_PROG_ARGS
# environmental variable.
my %opts;
@@ -189,10 +187,6 @@ There are also long command line options:
=over 4
-=item C<--running-make-test>
-
-Some test scripts run more quickly when this is set.
-
=item C<--gc-debug>
Invoke parrot with '--gc-debug'.
View
BIN t/native_pbc/annotations.pbc
Binary file not shown.
View
BIN t/native_pbc/integer_1.pbc
Binary file not shown.
View
BIN t/native_pbc/number_1.pbc
Binary file not shown.
View
BIN t/native_pbc/string_1.pbc
Binary file not shown.
View
841 t/op/trans.t
@@ -1,742 +1,127 @@
-#!perl
-# Copyright (C) 2001-2008, Parrot Foundation.
+#!parrot
+# Copyright (C) 2001-2010, Parrot Foundation.
# $Id$
-use strict;
-use warnings;
-use lib qw( . lib ../lib ../../lib );
-use Test::More;
-use Parrot::Test tests => 22;
-use Math::Trig qw( tan sec atan asin acos asec cosh sinh tanh sech );
-
=head1 NAME
-t/op/trans.t - Transcendental Mathematical Ops
+t/op/bitwise.t - Bitwise Ops
=head1 SYNOPSIS
- % prove t/op/trans.t
+ % prove t/op/trans.t
=head1 DESCRIPTION
-Tests the transcendental mathematical operations.
+Tests various bitwise logical operations.
=cut
-# This defines two macros:
-# fp_eq N, N, LABEL
-# fp_ne N, N, LABEL
-# which will conditionally branch
-# to LABEL if abs(n,n) < epsilon
-
-pasm_output_is( <<"CODE", <<OUTPUT, "sin" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- sin N2, N1
- .fp_eq_pasm (N2, 0.841471, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- sin N2, I1
- .fp_eq_pasm (N2, 0.841471, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "cos" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- cos N2, N1
- .fp_eq_pasm (N2, 0.540302, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- cos N2, I1
- .fp_eq_pasm (N2, 0.540302, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "tan" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- tan N2, N1
- .fp_eq_pasm (N2, 1.557408, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- tan N2, I1
- .fp_eq_pasm (N2, 1.557408, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "sec" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- sec N2, N1
- .fp_eq_pasm (N2, 1.850816, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- sec N2, I1
- .fp_eq_pasm (N2, 1.850816, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "atan" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- atan N2, N1
- .fp_eq_pasm (N2, 0.785398, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- atan N2, I1
- .fp_eq_pasm (N2,0.785398 , EQ2)
- print "not "
-EQ2: print "ok 2\\n"
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "asin" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- asin N2, N1
- .fp_eq_pasm (N2, 1.570796, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- asin N2, I1
- .fp_eq_pasm (N2, 1.570796 , EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "acos" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- acos N2, N1
- .fp_eq_pasm (N2, 0.000000, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- acos N2, I1
- .fp_eq_pasm (N2, 0.000000, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "asec" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- asec N2, N1
- .fp_eq_pasm (N2, 0.000000, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- asec N2, I1
- .fp_eq_pasm (N2, 0.000000, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "cosh" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- cosh N2, N1
- .fp_eq_pasm (N2, 1.543081, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- cosh N2, I1
- .fp_eq_pasm (N2, 1.543081, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-my $runcore = $ENV{TEST_PROG_ARGS} || '';
-my @bsdtodo = (
- $runcore =~ /--runcore=jit/ && $^O =~ m/bsd/i
- ? ( todo => 'broken under JIT TT #501' )
- : ()
-);
-
-pasm_output_is( <<"CODE", <<OUTPUT, "sinh", @bsdtodo );
- .include 'fp_equality.pasm'
- set N1, 1.0
- sinh N2, N1
- .fp_eq_pasm (N2, 1.175201, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- sinh N2, I1
- .fp_eq_pasm (N2, 1.175201, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "tanh", @bsdtodo );
- .include 'fp_equality.pasm'
- set N1, 1.0
- tanh N2, N1
- .fp_eq_pasm (N2, 0.761594, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- tanh N2, I1
- .fp_eq_pasm (N2, 0.761594, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "sech" );
- .include 'fp_equality.pasm'
- set N1, 1.0
- sech N2, N1
- .fp_eq_pasm (N2, 0.648054, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 1
- sech N2, I1
- .fp_eq_pasm (N2, 0.648054, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-my @jittodo = (
- $runcore =~ /--runcore=jit/
- ? ( todo => 'broken under JIT TT #530' )
- : ()
-);
-pasm_output_is( <<"CODE", <<OUTPUT, 'atan2', @jittodo );
- .include 'fp_equality.pasm'
- set N0, 0.0
- set I0, 0
- set N1, 1.0
- set I1, 1
- set N2, 1.0
- set I2, 1
- set I3, -1
- set N3, -1.0
-
- atan N4, N1, N2
- .fp_eq_pasm (N4, 0.785398, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- atan N4, N1, I2
- .fp_eq_pasm (N4, 0.785398, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- atan N4, I1, N2
- .fp_eq_pasm (N4, 0.785398, EQ3)
- print "not "
-EQ3: print "ok 3\\n"
-
- atan N4, I1, I2
- .fp_eq_pasm (N4, 0.785398, EQ4)
- print "not "
-EQ4: print "ok 4\\n"
-
- atan N4, N3, 1.0
- .fp_eq_pasm (N4, -0.785398, EQ5)
- print "not "
-EQ5: print "ok 5\\n"
-
- atan N4, N1, 0
- .fp_eq_pasm (N4, 1.570796, EQ6)
- print "not "
-EQ6: print "ok 6\\n"
-
- atan N4, I3, 0.0
- .fp_eq_pasm (N4, -1.570796, EQ7)
- print "not "
-EQ7: print "ok 7\\n"
-
- atan N4, I3, -1
- .fp_eq_pasm (N4, -2.356194, EQ8)
- print "not "
-EQ8: print "ok 8\\n"
-
- atan N4, 1.0, N3
- .fp_eq_pasm (N4, 2.356194, EQ9)
- print "not "
-EQ9: print "ok 9\\n"
-
- atan N4, 1.0, I0
- .fp_eq_pasm (N4, 1.570796, EQ10)
- print "not "
-EQ10: print "ok 10\\n"
-
- atan N4, 1, N1
- .fp_eq_pasm (N4, 0.785398, EQ11)
- print "not "
-EQ11: print "ok 11\\n"
-
- atan N4, 1, I1
- .fp_eq_pasm (N4, 0.785398, EQ12)
- print "not "
-EQ12: print "ok 12\\n"
-
- atan N4, 0.0, 1.0
- .fp_eq_pasm (N4, 0.000000, EQ13)
- print "not "
-EQ13: print "ok 13\\n"
-
- atan N4, -1.0, 0
- .fp_eq_pasm (N4, -1.570796, EQ14)
- print "not "
-EQ14: print "ok 14\\n"
-
- atan N4, 1, -1.0
- .fp_eq_pasm (N4, 2.356194, EQ15)
- print "not "
-EQ15: print "ok 15\\n"
-
- atan N4, 0, 1
- .fp_eq_pasm (N4, 0.000000, EQ16)
- print "not "
-EQ16: print "ok 16\\n"
- end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-ok 8
-ok 9
-ok 10
-ok 11
-ok 12
-ok 13
-ok 14
-ok 15
-ok 16
-OUTPUT
-
-pasm_output_is( <<"CODE", <<'OUTPUT', 'atan, part 2' );
- .include 'fp_equality.pasm'
- atan N4, -0.0, -0.0
- .fp_eq_pasm (N4, -3.1415926, EQ1)
- print "not "
- print N4
-EQ1: print "ok 1\\n"
- end
-CODE
-ok 1
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "log2" );
- .include 'fp_equality.pasm'
- set N1, 10.0
- log2 N2, N1
- .fp_eq_pasm (N2, 3.321928, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 10
- log2 N2, I1
- .fp_eq_pasm (N2, 3.321928, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "log10" );
- .include 'fp_equality.pasm'
- set N1, 15.0
- log10 N2, N1
- .fp_eq_pasm (N2, 1.176091, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 15
- log10 N2, I1
- .fp_eq_pasm (N2, 1.176091, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "ln" );
- .include 'fp_equality.pasm'
- set N1, 10.0
- ln N2, N1
- .fp_eq_pasm (N2, 2.302585, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 10
- ln N2, I1
- .fp_eq_pasm (N2, 2.302585, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "exp" );
- .include 'fp_equality.pasm'
- set N1, 10.0
- exp N2, N1
- .fp_eq_pasm (N2, 22026.465795, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 10
- exp N2, I1
- .fp_eq_pasm (N2, 22026.465795, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "pow", @bsdtodo );
- .include 'fp_equality.pasm'
- set N1, 3.0
- set I1, 3
- set N2, 5.0
- set I2, 5
- pow N3, N1, N2
- .fp_eq_pasm (N3, 243.0, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- pow N3, N1, I2
- .fp_eq_pasm (N3, 243.0, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- pow N3, I1, N2
- .fp_eq_pasm (N3, 243.0, EQ3)
- print "not "
-EQ3: print "ok 3\\n"
-
- pow N3, I1, I2
- .fp_eq_pasm (N3, 243.0, EQ4)
- print "not "
-EQ4: print "ok 4\\n"
-
- set N0, 0.0
- set I0, 0
- set N1, 1.0
- set I1, 1
- set N2, 4.0
- set I2, 4
- pow N3, N2, 2.5
- .fp_eq_pasm (N3, 32.0, EQ5)
- print "not "
-EQ5: print "ok 5\\n"
-
- pow N3, N2, -2
- .fp_eq_pasm (N3, 0.0625, EQ6)
- print "not "
-EQ6: print "ok 6\\n"
-
- pow N3, I2, 0.5
- .fp_eq_pasm (N3, 2.0, EQ7)
- print "not "
-EQ7: print "ok 7\\n"
-
- pow N3, I2, 0
- .fp_eq_pasm (N3, 1.0, EQ8)
- print "not "
-EQ8: print "ok 8\\n"
-
- pow N3, 0.0, N2
- .fp_eq_pasm (N3, 0.0, EQ9)
- print "not "
-EQ9: print "ok 9\\n"
-
- pow N3, 2.5, 0.0
- .fp_eq_pasm (N3, 1.0, EQ10)
- print "not "
-EQ10: print "ok 10\\n"
-
- pow N3, 2.5, I2
- .fp_eq_pasm (N3, 39.0625, EQ11)
- print "not "
-EQ11: print "ok 11\\n"
-
- pow N3, 2.0, -4
- .fp_eq_pasm (N3, 0.0625, EQ12)
- print "not "
-EQ12: print "ok 12\\n"
-
- pow N3, 0, N2
- .fp_eq_pasm (N3, 0.0, EQ13)
- print "not "
-EQ13: print "ok 13\\n"
-
- pow N3, 4, -0.5
- .fp_eq_pasm (N3, 0.5, EQ14)
- print "not "
-EQ14: print "ok 14\\n"
-
- pow N3, 4, I2
- .fp_eq_pasm (N3, 256.0, EQ15)
- print "not "
-EQ15: print "ok 15\\n"
-
- pow N3, 4, -1
- .fp_eq_pasm (N3, 0.25, EQ16)
- print "not "
-EQ16: print "ok 16\\n"
- end
-CODE
-ok 1
-ok 2
-ok 3
-ok 4
-ok 5
-ok 6
-ok 7
-ok 8
-ok 9
-ok 10
-ok 11
-ok 12
-ok 13
-ok 14
-ok 15
-ok 16
-OUTPUT
-
-pasm_output_is( <<"CODE", <<OUTPUT, "sqrt" );
- .include 'fp_equality.pasm'
- set N1, 9.0
- sqrt N2, N1
- .fp_eq_pasm (N2, 3.0, EQ1)
- print "not "
-EQ1: print "ok 1\\n"
-
- set I1, 9
- sqrt N2, I1
- .fp_eq_pasm (N2, 3.0, EQ2)
- print "not "
-EQ2: print "ok 2\\n"
-
- end
-CODE
-ok 1
-ok 2
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "pow_n_n_ic" );
- set N0, 2.0
- pow N1, N0, 0
- print N1
- print "\n"
- pow N1, N0, 1
- print N1
- print "\n"
- pow N1, N0, 2
- print N1
- print "\n"
- pow N1, N0, 3
- print N1
- print "\n"
- pow N1, N0, 4
- print N1
- print "\n"
- pow N1, N0, 5
- print N1
- print "\n"
- pow N1, N0, 6
- print N1
- print "\n"
- pow N1, N0, 7
- print N1
- print "\n"
- pow N1, N0, -1
- print N1
- print "\n"
- pow N1, N0, -2
- print N1
- print "\n"
- pow N1, N0, -3
- print N1
- print "\n"
- pow N1, N0, -4
- print N1
- print "\n"
- pow N1, N0, -5
- end
-CODE
-1
-2
-4
-8
-16
-32
-64
-128
-0.5
-0.25
-0.125
-0.0625
-OUTPUT
-
-pasm_output_is( <<'CODE', <<OUTPUT, "pow_n_n_i" );
- set N0, 2.0
- set I0, 0
- pow N1, N0, I0
- print N1
- print "\n"
- inc I0
- pow N1, N0, I0
- print N1
- print "\n"
- inc I0
- pow N1, N0, I0
- print N1
- print "\n"
- inc I0
- pow N1, N0, I0
- print N1
- print "\n"
- inc I0
- pow N1, N0, I0
- print N1
- print "\n"
- inc I0
- pow N1, N0, I0
- print N1
- print "\n"
- inc I0
- pow N1, N0, I0
- print N1
- print "\n"
- set I0, -1
- pow N1, N0, I0
- print N1
- print "\n"
- dec I0
- pow N1, N0, I0
- print N1
- print "\n"
- dec I0
- pow N1, N0, I0
- print N1
- print "\n"
- dec I0
- pow N1, N0, I0
- print N1
- print "\n"
- dec I0
- pow N1, N0, I0
- print N1
- print "\n"
- dec I0
- pow N1, N0, I0
- print N1
- print "\n"
- end
-CODE
-1
-2
-4
-8
-16
-32
-64
-0.5
-0.25
-0.125
-0.0625
-0.03125
-0.015625
-OUTPUT
+.sub main :main
+ .include 'test_more.pir'
+
+ plan(16)
+
+ test_sin_n()
+ test_sin_i()
+ test_cos_n()
+ test_cos_i()
+ test_tan_n()
+ test_tan_i()
+.end
+
+.sub _pi
+ .return (3.1415926535897)
+.end
+
+.sub _e
+ .return (2.7182818459045)
+.end
+
+.sub _epsilon
+ .return (0.0001)
+.end
+
+.sub test_sin_n
+ .local num epsilon
+ epsilon = _epsilon()
+
+ $N0 = sin 0.0
+ is($N0, 0.0, "sin(0.0)", epsilon)
+
+ $N0 = sin 1.0
+ is($N0, 0.841471, "sin(1.0)", epsilon)
+
+ $N1 = _pi()
+ $N0 = sin $N1
+ is($N0, 0.0, "sin(pi)", epsilon)
+
+ $N1 = _pi()
+ $N1 = $N1 / 2
+ $N0 = sin $N1
+ is($N0, 1.0, "sin(pi/2)", epsilon)
+.end
+
+.sub test_sin_i
+ .local num epsilon
+ epsilon = _epsilon()
+
+ $N0 = sin 0
+ is($N0, 0.0, "sin(0)", epsilon)
+
+ $N0 = sin 1
+ is($N0, 0.841471, "sin(1)", epsilon)
+.end
+
+.sub test_cos_n
+ .local num epsilon
+ epsilon = _epsilon()
+
+ $N0 = cos 0.0
+ is($N0, 1.0, "cos(0.0)", epsilon)
+
+ $N0 = cos 1.0
+ is($N0, 0.540302, "cos(1.0)", epsilon)
+
+ $N1 = _pi()
+ $N0 = cos $N1
+ is($N0, -1.0, "cos(pi)", epsilon)
+
+ $N1 = _pi()
+ $N1 = $N1 / 2
+ $N0 = cos $N1
+ is($N0, 0.0, "cos(pi/2)", epsilon)
+.end
+
+.sub test_cos_i
+ .local num epsilon
+ epsilon = _epsilon()
+
+ $N0 = cos 0
+ is($N0, 1.0, "cos(0)", epsilon)
+
+ $N0 = cos 1
+ is($N0, 0.540302, "cos(1)", epsilon)
+.end
+
+.sub test_tan_n
+ .local num epsilon
+ epsilon = _epsilon()
+
+ $N0 = tan 0.0
+ is($N0, 0.0, "tan(0.0)", epsilon)
+
+ $N0 = tan 1.0
+ is($N0, 1.557408, "tan(1.0)", epsilon)
+.end
+
+.sub test_tan_i
+ .local num epsilon
+ epsilon = _epsilon()
+
+ $N0 = tan 0
+ is($N0, 0.0, "tan(0)", epsilon)
+
+ $N0 = tan 1
+ is($N0, 1.557408, "tan(1)", epsilon)
+.end
-# Local Variables:
-# mode: cperl
-# cperl-indent-level: 4
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:
View
684 t/op/trans_old.t
@@ -0,0 +1,684 @@
+#!perl
+# Copyright (C) 2001-2008, Parrot Foundation.
+# $Id$
+
+use strict;
+use warnings;
+use lib qw( . lib ../lib ../../lib );
+use Test::More;
+use Parrot::Test tests => 19;
+use Math::Trig qw( tan sec atan asin acos asec cosh sinh tanh sech );
+
+=head1 NAME
+
+t/op/trans.t - Transcendental Mathematical Ops
+
+=head1 SYNOPSIS
+
+ % prove t/op/trans.t
+
+=head1 DESCRIPTION
+
+Tests the transcendental mathematical operations.
+
+=cut
+
+# This defines two macros:
+# fp_eq N, N, LABEL
+# fp_ne N, N, LABEL
+# which will conditionally branch
+# to LABEL if abs(n,n) < epsilon
+
+pasm_output_is( <<"CODE", <<OUTPUT, "sec" );
+ .include 'fp_equality.pasm'
+ set N1, 1.0
+ sec N2, N1
+ .fp_eq_pasm (N2, 1.850816, EQ1)
+ print "not "
+EQ1: print "ok 1\\n"
+
+ set I1, 1
+ sec N2, I1
+ .fp_eq_pasm (N2, 1.850816, EQ2)
+ print "not "
+EQ2: print "ok 2\\n"
+ end
+CODE
+ok 1
+ok 2
+OUTPUT
+
+pasm_output_is( <<"CODE", <<OUTPUT, "atan" );
+ .include 'fp_equality.pasm'
+ set N1, 1.0
+ atan N2, N1
+ .fp_eq_pasm (N2, 0.785398, EQ1)
+ print "not "
+EQ1: print "ok 1\\n"
+
+ set I1, 1
+ atan N2, I1
+ .fp_eq_pasm (N2,0.785398 , EQ2)
+ print "not "
+EQ2: print "ok 2\\n"
+ end
+CODE
+ok 1
+ok 2
+OUTPUT
+
+pasm_output_is( <<"CODE", <<OUTPUT, "asin" );
+ .include 'fp_equality.pasm'
+ set N1, 1.0
+ asin N2, N1
+ .fp_eq_pasm (N2, 1.570796, EQ1)
+ print "not "
+EQ1: print "ok 1\\n"
+
+ set I1, 1
+ asin N2, I1