From patchwork Tue Nov 4 15:40:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 3572 Received: (qmail 11937 invoked by alias); 4 Nov 2014 15:41:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 11927 invoked by uid 89); 4 Nov 2014 15:41:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp14.uk.ibm.com Received: from e06smtp14.uk.ibm.com (HELO e06smtp14.uk.ibm.com) (195.75.94.110) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 04 Nov 2014 15:41:23 +0000 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 4 Nov 2014 15:41:20 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 4 Nov 2014 15:41:19 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id 733A31B0804B for ; Tue, 4 Nov 2014 15:41:24 +0000 (GMT) Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sA4FfIxu16646622 for ; Tue, 4 Nov 2014 15:41:18 GMT Received: from d06av01.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sA4FfHEu013111 for ; Tue, 4 Nov 2014 08:41:18 -0700 Received: from br87z6lw.boeblingen.de.ibm.com (dyn-9-152-212-196.boeblingen.de.ibm.com [9.152.212.196]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id sA4FetuM012032; Tue, 4 Nov 2014 08:41:17 -0700 From: Andreas Arnez To: gdb-patches@sourceware.org Cc: Mark Kettenis , dje@google.com, sandra@codesourcery.com Subject: [PATCH 2/3] Perform all tests in callfuncs.exp with and without C function prototypes Date: Tue, 4 Nov 2014 16:40:44 +0100 Message-Id: <1415115655-4077-3-git-send-email-arnez@linux.vnet.ibm.com> In-Reply-To: <1415115655-4077-1-git-send-email-arnez@linux.vnet.ibm.com> References: <1415115655-4077-1-git-send-email-arnez@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14110415-0017-0000-0000-000001B606A3 X-IsSubscribed: yes In callfuncs.exp, compile callfuncs.c with and without C function header prototypes and execute all tests after each compilation. gdb/testsuite/ChangeLog: * gdb.base/callfuncs.exp: Remove 'prototypes' variable. Move main logic into perform_all_tests() and invoke it with and without function header prototypes. (do_function_calls): Remove conditional XFAIL for PR 5318. (rerun_and_prepare): Remove duplicate code. (perform_all_tests): New. Main logic moved here. --- gdb/testsuite/gdb.base/callfuncs.exp | 59 +++++++++--------------------------- 1 file changed, 15 insertions(+), 44 deletions(-) diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index cff8bd0..1930dc3 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -23,24 +23,6 @@ if [support_complex_tests] { lappend compile_flags "additional_flags=-DTEST_COMPLEX" } -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable $compile_flags] != "" } { - untested callfuncs.exp - return -1 -} - -# Create and source the file that provides information about the compiler -# used to compile the test case. - -if [get_compiler_info] { - return -1 -} - -if {$hp_aCC_compiler} { - set prototypes 1 -} else { - set prototypes 0 -} - # Some targets can't do function calls, so don't even bother with this # test. if [target_info exists gdb,cannot_call_functions] { @@ -57,7 +39,6 @@ if [target_info exists gdb,cannot_call_functions] { # (computed in the inferior) is 1 for true and 0 for false. proc do_function_calls {} { - global prototypes global gdb_prompt # We need to up this because this can be really slow on some boards. @@ -117,15 +98,6 @@ proc do_function_calls {} { # Test passing of arguments which might not be widened. gdb_test "p t_float_values2(0.0,0.0)" " = 0" - # Although PR 5318 mentions SunOS specifically, this seems - # to be a generic problem on quite a few platforms. - if $prototypes then { - setup_xfail "sparc-*-*" "mips*-*-*" 5318 - if { ! [test_compiler_info gcc-*-*] } then { - setup_xfail "i*86-*-sysv4*" 5318 - } - } - gdb_test "p t_float_values2(3.14159,float_val2)" " = 1" gdb_test "p t_float_many_args (float_val1, float_val2, float_val3, float_val4, float_val5, float_val6, float_val7, float_val8, float_val9, float_val10, float_val11, float_val12, float_val13, float_val14, float_val15)" " = 1" "Call function with many float arguments." @@ -321,23 +293,18 @@ proc fetch_all_registers {test} { proc rerun_and_prepare {} { global hp_aCC_compiler + if { ![runto_main] } { + gdb_suppress_tests + } if { $hp_aCC_compiler } { # Do not set language explicitly to 'C'. This will cause aCC # tests to fail because promotion rules are different. Just let # the language be set to the default. - - if { ![runto_main] } { - gdb_suppress_tests - } - # However, turn off overload-resolution for aCC. Having it on causes # a lot of failures. gdb_test_no_output "set overload-resolution 0" } else { - if { ![runto_main] } { - gdb_suppress_tests - } gdb_test_no_output "set language c" } @@ -351,14 +318,7 @@ proc rerun_and_prepare {} { "next to t_structs_c" } - -# Start with a fresh gdb. - -gdb_exit -gdb_start -gdb_reinitialize_dir $srcdir/$subdir -gdb_load ${binfile} - +proc perform_all_tests {} { gdb_test_no_output "set print sevenbit-strings" gdb_test_no_output "set print address off" gdb_test_no_output "set width 0" @@ -538,3 +498,14 @@ gdb_test "print callfunc (Lcallfunc, 5)" " = 12" # Regression test for function pointer cast. gdb_test "print *((int *(*) (void)) voidfunc)()" " = 23" +} + +# Perform all tests with and without function prototypes. + +if { ![prepare_for_testing ${testfile}.exp $testfile $srcfile "$compile_flags additional_flags=-DPROTOTYPES"] } { + perform_all_tests +} + +if { ![prepare_for_testing ${testfile}.exp $testfile $srcfile "$compile_flags additional_flags=-DNO_PROTOTYPES"] } { + with_test_prefix "noproto" perform_all_tests +}