1
# Copyright (C) 2014, Parrot Foundation.
5
config/auto/expect.pm - HAS_BUILTIN_EXPECT
9
Check if the compiler understands __builtin_expect
18
use base qw(Parrot::Configure::Step);
20
use Parrot::Configure::Utils ':auto';
25
$data{description} = q{Does your compiler support __builtin_expect};
31
my ( $self, $conf ) = @_;
33
# gcc and clang should have it
35
$conf->data->set( 'HAS_BUILTIN_EXPECT' => 1 );
36
$conf->debug("DEBUG: __builtin_expect detected\n");
37
$self->set_result('yes');
40
$conf->data->set( 'HAS_BUILTIN_EXPECT' => 0 );
41
$conf->debug("DEBUG: __builtin_expect not detected\n");
42
$self->set_result('no');
47
#################### INTERNAL SUBROUTINES ####################
52
$conf->cc_gen('config/auto/expect/test_c.in');
53
eval { $conf->cc_build() };
54
my $ret = $@ ? 0 : eval $conf->cc_run();
64
# cperl-indent-level: 4
67
# vim: expandtab shiftwidth=4: