diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-03-24 16:30:26 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-03-24 16:30:26 +0000 |
commit | 70ceb34a909fb6c80c73c6f464c828728c2c8877 (patch) | |
tree | 8c4a3cec3df914da2ce806bcdcd1e6b7627abc13 /Configure | |
parent | ed1b9de06a0ca967d0a805d341b8c031df2a4b41 (diff) | |
download | perl-70ceb34a909fb6c80c73c6f464c828728c2c8877.tar.gz |
Give the test file for __builtin_expect() the correct name (try.c, not
builtin.c). Correct the user visible text, which was clearly a cut &
paste from __builtin_choose_expr. For both, also run the program as
part of the checks. Add a return value to the test program, and make
it return something useful (that the if statement worked).
p4raw-id: //depot/perl@33551
Diffstat (limited to 'Configure')
-rwxr-xr-x | Configure | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -10554,7 +10554,7 @@ int main(void) { EOCP set try - if eval $compile; then + if eval $compile && $run ./try; then echo "Your C compiler supports __builtin_choose_expr." val="$define" else @@ -10574,18 +10574,20 @@ case "$d_builtin_expect" in '') echo " " echo "Checking whether your compiler can handle __builtin_expect ..." >&4 - $cat >builtin.c <<'EOCP' + $cat >try.c <<'EOCP' int main(void) { int n = 50; if ( __builtin_expect(n, 0) ) n = 1; + /* Remember shell exit code truth is 0, C truth is non-zero */ + return !(n == 1); } EOCP set try - if eval $compile; then - echo "Your C compiler supports __builtin_choose_expr." + if eval $compile && $run ./try; then + echo "Your C compiler supports __builtin_expect." val="$define" else - echo "Your C compiler doesn't seem to understand __builtin_choose_expr." + echo "Your C compiler doesn't seem to understand __builtin_expect." val="$undef" fi ;; |