From 72fbdf834da070f900ecc078217f9011ee16d99e Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sat, 7 Mar 2020 22:46:07 +0100 Subject: [PATCH] [gdb/testsuite] Fix testing build_executable result When running with target board unix/-feliminate-dwarf2-dups, we run into these FAILs: ... FAIL: gdb.cp/rvalue-ref-params.exp: print value of f1 on Child&& in f2 FAIL: gdb.cp/ref-params.exp: print value of f1 on Child in main FAIL: gdb.cp/ref-params.exp: print value of f2 on Child in main FAIL: gdb.cp/ref-params.exp: print value of f1 on Child& in f2 FAIL: gdb.cp/ref-params.exp: print mf1(MQ) FAIL: gdb.cp/ref-params.exp: print mf2(MQ) FAIL: gdb.cp/ref-params.exp: print f1(MQR) FAIL: gdb.cp/ref-params.exp: print mf1(MQR) FAIL: gdb.cp/ref-params.exp: print mf2(MQR) ... This is due to comparing the result of build_executable to 1, while build_executable returns either 0 for success, or -1 for failure. Fix this by comparing with -1 instead. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-03-07 Tom de Vries * gdb.cp/ref-params.exp: Compare build_executable result with -1. * gdb.cp/rvalue-ref-params.exp: Same. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.cp/ref-params.exp | 2 +- gdb/testsuite/gdb.cp/rvalue-ref-params.exp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 912cdf3dbe2..c3dda74cc8e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-03-07 Tom de Vries + + * gdb.cp/ref-params.exp: Compare build_executable result with -1. + * gdb.cp/rvalue-ref-params.exp: Same. + 2020-03-06 Tom de Vries * lib/gdb.exp (tentative_rename, cached_file): New proc. diff --git a/gdb/testsuite/gdb.cp/ref-params.exp b/gdb/testsuite/gdb.cp/ref-params.exp index 2b45ee7fc8d..2b005017060 100644 --- a/gdb/testsuite/gdb.cp/ref-params.exp +++ b/gdb/testsuite/gdb.cp/ref-params.exp @@ -24,7 +24,7 @@ if { [skip_cplus_tests] } { continue } standard_testfile .cc -if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == 1} { +if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} { return -1 } diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp index e1c54aa40af..fec4b6faddc 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp +++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp @@ -21,7 +21,7 @@ if {[skip_cplus_tests]} { continue } standard_testfile .cc if {[prepare_for_testing $testfile.exp $testfile $srcfile \ - {debug c++ additional_flags="-std=gnu++11"}] == 1} { + {debug c++ additional_flags="-std=gnu++11"}] == -1} { return -1 } -- 2.30.2