Index: MANIFEST =================================================================== --- MANIFEST (revision 41543) +++ MANIFEST (working copy) @@ -1,7 +1,7 @@ # ex: set ro: # $Id$ # -# generated by tools/dev/mk_manifest_and_skip.pl Sat Sep 19 08:24:23 2009 UT +# generated by tools/dev/mk_manifest_and_skip.pl Tue Sep 29 01:34:44 2009 UT # # See below for documentation on the format of this file. # @@ -236,8 +236,6 @@ config/auto/frames/test_exec_cygwin_c.in [] config/auto/frames/test_exec_linux_c.in [] config/auto/frames/test_exec_openbsd_c.in [] -config/auto/funcptr.pm [] -config/auto/funcptr/test_c.in [] config/auto/gc.pm [] config/auto/gc/test_c.in [] config/auto/gcc.pm [] @@ -1922,7 +1920,6 @@ t/steps/auto/env-01.t [test] t/steps/auto/format-01.t [test] t/steps/auto/frames-01.t [test] -t/steps/auto/funcptr-01.t [test] t/steps/auto/gc-01.t [test] t/steps/auto/gcc-01.t [test] t/steps/auto/gdbm-01.t [test] Index: lib/Parrot/Configure/Step/List.pm =================================================================== --- lib/Parrot/Configure/Step/List.pm (revision 41543) +++ lib/Parrot/Configure/Step/List.pm (working copy) @@ -42,7 +42,6 @@ auto::jit auto::frames auto::cpu - auto::funcptr auto::cgoto auto::inline auto::gc Index: Configure.pl =================================================================== --- Configure.pl (revision 41543) +++ Configure.pl (working copy) @@ -623,7 +623,6 @@ auto::jit auto::frames auto::cpu - auto::funcptr auto::cgoto auto::inline auto::gc Index: t/steps/auto/funcptr-01.t =================================================================== --- t/steps/auto/funcptr-01.t (revision 41543) +++ t/steps/auto/funcptr-01.t (working copy) @@ -1,134 +0,0 @@ -#! perl -# Copyright (C) 2007, Parrot Foundation. -# $Id$ -# auto/funcptr-01.t - -use strict; -use warnings; -use Test::More tests => 28; -use Carp; -use lib qw( lib t/configure/testlib ); -use_ok('config::init::defaults'); -use_ok('config::auto::funcptr'); -use Parrot::BuildUtil; -use Parrot::Configure; -use Parrot::Configure::Options qw( process_options ); -use Parrot::Configure::Test qw( test_step_thru_runstep); -use Parrot::Configure::Test qw( - test_step_thru_runstep - rerun_defaults_for_testing - test_step_constructor_and_description -); -use IO::CaptureOutput qw( capture ); - -########### --jitcapable=0 ########### - -my ($args, $step_list_ref) = process_options( { - argv => [ q{--jitcapable=0} ], - mode => q{configure}, -} ); - -my $conf = Parrot::Configure->new(); - -my $serialized = $conf->pcfreeze(); - -test_step_thru_runstep($conf, q{init::defaults}, $args); - -my $pkg = q{auto::funcptr}; - -$conf->add_steps($pkg); -$conf->options->set(%{$args}); -my $step = test_step_constructor_and_description($conf); -my $ret = $step->runstep($conf); -ok($ret, "runstep() returned defined value" ); - -$conf->replenish($serialized); - -########### _cast_void_pointers_msg() ########### - -($args, $step_list_ref) = process_options( { - argv => [ ], - mode => q{configure}, -} ); -rerun_defaults_for_testing($conf, $args ); -$conf->add_steps($pkg); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -{ - my $stdout; - my $ret = capture( - sub { auto::funcptr::_cast_void_pointers_msg(); }, - \$stdout, - ); - like($stdout, qr/Although it is not required/s, - "Got expected advisory message"); -} - -########### _set_positive_result() ########### - -{ - my $stdout; - my $ret = capture( - sub { auto::funcptr::_set_positive_result($step, $conf); }, - \$stdout, - ); - is($step->result, q{yes}, "Got expected result"); - ok(! $stdout, "Nothing printed to STDOUT, as expected"); -} - -$conf->replenish($serialized); - -########### --verbose; _set_positive_result() ########### - -($args, $step_list_ref) = process_options( { - argv => [ q{--verbose} ], - mode => q{configure}, -} ); -rerun_defaults_for_testing($conf, $args ); -$conf->add_steps($pkg); -$conf->options->set( %{$args} ); -$step = test_step_constructor_and_description($conf); -{ - my $stdout; - my $ret = capture( - sub { auto::funcptr::_set_positive_result($step, $conf); }, - \$stdout, - ); - is($step->result, q{yes}, "Got expected result"); - like($stdout, qr/yes/, "Got expected verbose output"); -} - -pass("Completed all tests in $0"); - -################### DOCUMENTATION ################### - -=head1 NAME - -auto/funcptr-01.t - test auto::funcptr - -=head1 SYNOPSIS - - % prove t/steps/auto/funcptr-01.t - -=head1 DESCRIPTION - -The files in this directory test functionality used by F. - -The tests in this file test aspects of auto::funcptr. - -=head1 AUTHOR - -James E Keenan - -=head1 SEE ALSO - -config::auto::funcptr, F. - -=cut - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: Index: config/auto/funcptr.pm =================================================================== --- config/auto/funcptr.pm (revision 41543) +++ config/auto/funcptr.pm (working copy) @@ -1,80 +0,0 @@ -# Copyright (C) 2001-2003, Parrot Foundation. -# $Id$ - -=head1 NAME - -config/auto/funcptr.pm - Function Pointer Casts - -=head1 DESCRIPTION - -Verifies that the compiler supports function pointer casts. - -=cut - -package auto::funcptr; - -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{Does compiler support function pointer casts}; - $data{result} = q{}; - return \%data; -} - -sub runstep { - my ( $self, $conf ) = @_; - - my $jitcapable = $conf->data->get('jitcapable'); - - if ($jitcapable) { - $conf->cc_gen('config/auto/funcptr/test_c.in'); - eval { $conf->cc_build(); }; - - if ( $@ || $conf->cc_run() !~ /OK/ ) { - _cast_void_pointers_msg(); - exit(-1); - } - $conf->cc_clean(); - $self->_set_positive_result($conf); - } - - return 1; -} - -sub _cast_void_pointers_msg { - print <<"END"; -Although it is not required by the ANSI C standard, -Parrot requires the ability to cast from void pointers to function -pointers for its JIT support. - -Your compiler does not appear to support this behavior with the -flags you have specified. You must adjust your settings in order -to use the JIT code. - -If you wish to continue without JIT support, please re-run this script -With the '--jitcapable=0' argument. -END -} - -sub _set_positive_result { - my ($self, $conf) = @_; - print " (yes) " if $conf->options->get('verbose'); - $self->set_result('yes'); -} - -1; - -# Local Variables: -# mode: cperl -# cperl-indent-level: 4 -# fill-column: 100 -# End: -# vim: expandtab shiftwidth=4: Index: config/auto/funcptr/test_c.in =================================================================== --- config/auto/funcptr/test_c.in (revision 41543) +++ config/auto/funcptr/test_c.in (working copy) @@ -1,43 +0,0 @@ -/* -Copyright (C) 2002-2009, Parrot Foundation. -$Id$ - -figure out if the compiler will let us do non-ansi function pointer casts. -*/ - -#include - -int -a_function(int some_number) -{ - if (some_number == 42) { - printf("OK\n"); - return 0; - } - else { - printf("FAIL\n"); - return -1; - } -} - -typedef int (*func_t)(int); - -int -main(int argc, char *argv[]) -{ - void *voidptr; - func_t funcptr; - - voidptr = (void *)a_function; - funcptr = a_function; - funcptr = (func_t)voidptr; - - return funcptr(42); -} - -/* - * Local variables: - * c-file-style: "parrot" - * End: - * vim: expandtab shiftwidth=4: - */