* lib/Parrot/Pmc2c/MethodEmitter.pm:
[parrot.git] / config / auto / va_ptr.pm
blobca7e8387da222f012c50623c1acf9989541bf0d4
1 # Copyright (C) 2001-2007, The Perl Foundation.
2 # $Id$
4 =head1 NAME
6 config/auto/va_ptr.pm - va_list to va_ptr conversion test
8 =head1 DESCRIPTION
10 Tests which kind of PARROT_VA_TO_VAPTR to use.
12 =cut
14 package auto::va_ptr;
16 use strict;
17 use warnings;
19 use base qw(Parrot::Configure::Step);
21 use Parrot::Configure::Utils ':auto';
24 sub _init {
25 my $self = shift;
26 my %data;
27 $data{description} =
28 q{Test the type of va_ptr (this test is likely to segfault)};
29 $data{result} = q{};
30 return \%data;
33 sub runstep {
34 my ( $self, $conf ) = @_;
36 my $va_type;
37 $conf->cc_gen('config/auto/va_ptr/test_c.in');
38 eval { $conf->cc_build('-DVA_TYPE_STACK'); };
40 if ( $@ || $conf->cc_run() !~ /^ok/ ) {
41 eval { $conf->cc_build('-DVA_TYPE_REGISTER'); };
42 if ( $@ || $conf->cc_run() !~ /^ok/ ) {
43 die "Unknown va_ptr type";
45 $va_type = 'register';
47 else {
48 $va_type = 'stack';
50 $conf->cc_clean();
51 $self->set_result($va_type);
52 $conf->data->set( va_ptr_type => $va_type );
54 return 1;
59 # Local Variables:
60 # mode: cperl
61 # cperl-indent-level: 4
62 # fill-column: 100
63 # End:
64 # vim: expandtab shiftwidth=4: