File Coverage

File:config/auto/cpu/i386/auto.pm
Coverage:90.6%

linestmtbrancondsubcode
1# Copyright (C) 2001-2006, Parrot Foundation.
2
3 - 13
=head1 NAME

config/auto/cpu/i386/auto.pm

=head1 DESCRIPTION

Test for cmpxchg ASM functionality. Creates these Config entries

 i386_has_gcc_cmpxchg_c   => 1

=cut
14
15package auto::cpu::i386::auto;
16
17
1
1
1
use strict;
18
1
1
1
use warnings;
19
20sub runstep {
21
1
    my ( $self, $conf ) = @_;
22
23
1
    my @files = qw( test_gcc_cmpxchg_c.in );
24
1
    for my $f (@files) {
25
1
        $conf->debug(" $f ");
26
1
        my ($suffix) = $f =~ /test_(\w+)/;
27
1
        my $path_f = "config/auto/cpu/i386/$f";
28
1
        $conf->cc_gen($path_f);
29
1
1
        eval { $conf->cc_build("-DPARROT_CONFIG_TEST") };
30
1
        if ($@) {
31
0
            $conf->debug(" $@ ");
32        }
33        else {
34
1
            if ( $conf->cc_run() =~ /ok/ ) {
35
1
                _handle_cc_run_ok($conf, $suffix, $path_f);
36            }
37        }
38
1
        $conf->cc_clean();
39    }
40
1
    return;
41}
42
43sub _handle_cc_run_ok {
44
1
    my ($conf, $suffix, $path_f) = @_;
45
1
    $conf->data->set(
46        "i386_has_$suffix" => '1',
47        "HAS_i386_$suffix" => '1',
48    );
49
1
    $conf->debug(" (\U$suffix) ");
50}
51
521;
53
54# Local Variables:
55# mode: cperl
56# cperl-indent-level: 4
57# fill-column: 100
58# End:
59# vim: expandtab shiftwidth=4: