From patchwork Tue Nov 15 10:42:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 60638 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9D8A8393BA59 for ; Tue, 15 Nov 2022 10:45:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9D8A8393BA59 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668509114; bh=W6/Lm7vIcbqyhD13C38mE234lu2OkoX7QlFHD6T8C78=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Mc/f9Ge+Fp6bpXLhzIPSdqmXpzqrLEmn/E3LNFOeMkkFvcUtIqUR/J9X7nmE6xhMQ m+TPPPTbqzypKddrSwvDhiwPX5tqzwgyBb8X6yrwaIr0KrQwxRGPI1vnEyjP0mBmo0 gF44E06wtvElc3olh+roTL8cKLMKa0SJifLbCE3g= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 25FD03894C0E for ; Tue, 15 Nov 2022 10:43:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 25FD03894C0E Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-647-GfeHCBePOSSsqCJeWHc_Bw-1; Tue, 15 Nov 2022 05:43:00 -0500 X-MC-Unique: GfeHCBePOSSsqCJeWHc_Bw-1 Received: by mail-qt1-f197.google.com with SMTP id cj6-20020a05622a258600b003a519d02f59so9899162qtb.5 for ; Tue, 15 Nov 2022 02:43:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W6/Lm7vIcbqyhD13C38mE234lu2OkoX7QlFHD6T8C78=; b=Mgwyr2WH4N4+snTfG3wPhMq6yg2KxE2cq3N1Ljv5RSBlY+KZWGfb73Ht0NVDk5XlIC 90rcwwrRO1JfmjvuR0DRCaD+oRC5WWfFeRUS5v015MzEy1HgIJsBBMtnOC7hB+6pCgob WlIEG/ljuTBrF+D7EMm0CxfhOkW0Z+QcW+IfFO4ubYpksGdTrwTV0++8TCYJDvkynlbm Yehr6qUUs8OhDKHhl07rF9SOnWJvpC4TvTb6zy5bbopBjmT5hjCeO23GUEDb+tS/AJc7 GqGqB2Fh6Lv7oXGRCMIjA+hVQtuMQ8bLwbl7OZiVl/Q1gkMRWs24ujEA3HpR77Ftxzke BX4g== X-Gm-Message-State: ANoB5pmVoyV2fOn/tK3G6OcOb+EmTbCkpM5YmOtpNyQytvKecaJLxrzt Qj7Elwni/ParPjZlKy4iHppw6y6Y+ypUIBdoDNZqXD0XOzltHjzK7OAqdd3X7G/15LB6gX1pL8F rk7BIetxZlHIalFZLuvk8n5VOmOK7DU5xmYz/vXIHHwCeQNAD84gNwg5rtlOlga1UzkJ2Y9+9Gw == X-Received: by 2002:ac8:7588:0:b0:3a5:6652:4414 with SMTP id s8-20020ac87588000000b003a566524414mr15737438qtq.645.1668508979841; Tue, 15 Nov 2022 02:42:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf7MB++bmfG7I5/U0BYfZdbf28enhzmSQSWeLYbGSE2uFV5XucZyp2mguxpY2pURJc6VrkFJJA== X-Received: by 2002:ac8:7588:0:b0:3a5:6652:4414 with SMTP id s8-20020ac87588000000b003a566524414mr15737413qtq.645.1668508979436; Tue, 15 Nov 2022 02:42:59 -0800 (PST) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id x15-20020ac87a8f000000b0039cc64bcb53sm6928217qtr.27.2022.11.15.02.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Nov 2022 02:42:59 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 11/14] gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp Date: Tue, 15 Nov 2022 10:42:28 +0000 Message-Id: <904a8ca4f21695ff92270f78a187bb474955cedb.1668508387.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" The canonical form of 'if' in modern TCL is 'if {} {}'. But there's still a bunch of places in the testsuite where we make use of the 'then' keyword, and sometimes these get copies into new tests, which just spreads poor practice. This commit removes all use of the 'then' keyword from the gdb.fortran/ test script directory. There should be no changes in what is tested after this commit. --- gdb/testsuite/gdb.fortran/array-element.exp | 2 +- gdb/testsuite/gdb.fortran/block-data.exp | 2 +- gdb/testsuite/gdb.fortran/common-block.exp | 2 +- gdb/testsuite/gdb.fortran/complex.exp | 2 +- gdb/testsuite/gdb.fortran/derived-type-function.exp | 2 +- gdb/testsuite/gdb.fortran/derived-type-striding.exp | 2 +- gdb/testsuite/gdb.fortran/derived-type.exp | 2 +- gdb/testsuite/gdb.fortran/dot-ops.exp | 2 +- gdb/testsuite/gdb.fortran/exprs.exp | 2 +- gdb/testsuite/gdb.fortran/function-calls.exp | 2 +- gdb/testsuite/gdb.fortran/library-module.exp | 2 +- gdb/testsuite/gdb.fortran/module.exp | 2 +- gdb/testsuite/gdb.fortran/namelist.exp | 2 +- gdb/testsuite/gdb.fortran/nested-funcs-2.exp | 2 +- gdb/testsuite/gdb.fortran/nested-funcs.exp | 2 +- gdb/testsuite/gdb.fortran/printing-types.exp | 2 +- gdb/testsuite/gdb.fortran/ptr-indentation.exp | 2 +- gdb/testsuite/gdb.fortran/ptype-on-functions.exp | 2 +- gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp | 2 +- gdb/testsuite/gdb.fortran/subarray.exp | 2 +- gdb/testsuite/gdb.fortran/type-kinds.exp | 2 +- gdb/testsuite/gdb.fortran/types.exp | 2 +- gdb/testsuite/gdb.fortran/vla-value.exp | 2 +- 23 files changed, 23 insertions(+), 23 deletions(-) diff --git a/gdb/testsuite/gdb.fortran/array-element.exp b/gdb/testsuite/gdb.fortran/array-element.exp index 22b72e2974b..f5d313cdf1a 100644 --- a/gdb/testsuite/gdb.fortran/array-element.exp +++ b/gdb/testsuite/gdb.fortran/array-element.exp @@ -26,7 +26,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } -if ![runto sub_] then { +if {![runto sub_]} { perror "couldn't run to breakpoint sub_" return } diff --git a/gdb/testsuite/gdb.fortran/block-data.exp b/gdb/testsuite/gdb.fortran/block-data.exp index 482dcc296b2..ab064910108 100644 --- a/gdb/testsuite/gdb.fortran/block-data.exp +++ b/gdb/testsuite/gdb.fortran/block-data.exp @@ -30,7 +30,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} { return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.fortran/common-block.exp b/gdb/testsuite/gdb.fortran/common-block.exp index e8d7c222134..b8cbfb895c5 100644 --- a/gdb/testsuite/gdb.fortran/common-block.exp +++ b/gdb/testsuite/gdb.fortran/common-block.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \ return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/complex.exp b/gdb/testsuite/gdb.fortran/complex.exp index 9298b3be56c..896e01cb932 100644 --- a/gdb/testsuite/gdb.fortran/complex.exp +++ b/gdb/testsuite/gdb.fortran/complex.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90 quiet return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "Couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/derived-type-function.exp b/gdb/testsuite/gdb.fortran/derived-type-function.exp index 573444a5808..3adabd63d36 100644 --- a/gdb/testsuite/gdb.fortran/derived-type-function.exp +++ b/gdb/testsuite/gdb.fortran/derived-type-function.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/derived-type-striding.exp b/gdb/testsuite/gdb.fortran/derived-type-striding.exp index 1edc489bcfb..bf868f57284 100644 --- a/gdb/testsuite/gdb.fortran/derived-type-striding.exp +++ b/gdb/testsuite/gdb.fortran/derived-type-striding.exp @@ -29,7 +29,7 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ return -1 } -if {![runto [gdb_get_line_number "post_init"]]} then { +if {![runto [gdb_get_line_number "post_init"]]} { perror "couldn't run to breakpoint post_init" return } diff --git a/gdb/testsuite/gdb.fortran/derived-type.exp b/gdb/testsuite/gdb.fortran/derived-type.exp index b3be8e57056..63ec0c8d0ba 100644 --- a/gdb/testsuite/gdb.fortran/derived-type.exp +++ b/gdb/testsuite/gdb.fortran/derived-type.exp @@ -27,7 +27,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/dot-ops.exp b/gdb/testsuite/gdb.fortran/dot-ops.exp index fefa27b87db..2bad2bc7c8f 100644 --- a/gdb/testsuite/gdb.fortran/dot-ops.exp +++ b/gdb/testsuite/gdb.fortran/dot-ops.exp @@ -153,7 +153,7 @@ proc test_dot_operations {} { clean_restart -if [set_lang_fortran] then { +if {[set_lang_fortran]} { test_dot_operations } else { warning "$test_name tests suppressed." 0 diff --git a/gdb/testsuite/gdb.fortran/exprs.exp b/gdb/testsuite/gdb.fortran/exprs.exp index 28c0a86f239..c14cdad4ff5 100644 --- a/gdb/testsuite/gdb.fortran/exprs.exp +++ b/gdb/testsuite/gdb.fortran/exprs.exp @@ -249,7 +249,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_test "set print sevenbit-strings" "" -if [set_lang_fortran] then { +if {[set_lang_fortran]} { test_value_history test_convenience_variables test_integer_literals_accepted diff --git a/gdb/testsuite/gdb.fortran/function-calls.exp b/gdb/testsuite/gdb.fortran/function-calls.exp index bc0192be064..ea58e6249c9 100644 --- a/gdb/testsuite/gdb.fortran/function-calls.exp +++ b/gdb/testsuite/gdb.fortran/function-calls.exp @@ -39,7 +39,7 @@ with_complaints 5 { } } -if {![runto [gdb_get_line_number "post_init"]]} then { +if {![runto [gdb_get_line_number "post_init"]]} { perror "couldn't run to breakpoint post_init" return } diff --git a/gdb/testsuite/gdb.fortran/library-module.exp b/gdb/testsuite/gdb.fortran/library-module.exp index 1745360d80c..a6ed67d404f 100644 --- a/gdb/testsuite/gdb.fortran/library-module.exp +++ b/gdb/testsuite/gdb.fortran/library-module.exp @@ -39,7 +39,7 @@ clean_restart $testfile gdb_load_shlib $libfile -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp index fe539fbc6d3..b9c9d6b44f3 100644 --- a/gdb/testsuite/gdb.fortran/module.exp +++ b/gdb/testsuite/gdb.fortran/module.exp @@ -34,7 +34,7 @@ gdb_test "print mod1::var_const" " = 20" "fully qualified name of DW_TAG_constan # Avoid shared lib symbols. gdb_test_no_output "set auto-solib-add off" -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/namelist.exp b/gdb/testsuite/gdb.fortran/namelist.exp index 39cf0e17654..46f24f47970 100644 --- a/gdb/testsuite/gdb.fortran/namelist.exp +++ b/gdb/testsuite/gdb.fortran/namelist.exp @@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp index bf679447c03..2a83144b648 100644 --- a/gdb/testsuite/gdb.fortran/nested-funcs-2.exp +++ b/gdb/testsuite/gdb.fortran/nested-funcs-2.exp @@ -108,7 +108,7 @@ proc do_bp_tests {with_src_prefix_p with_nest_prefix_p} { } # Break on a contained function and run to it. - if {![runto ${src_prefix}[gdb_get_line_number "pre_init"]]} then { + if {![runto ${src_prefix}[gdb_get_line_number "pre_init"]]} { perror "couldn't run to breakpoint pre_init" return } diff --git a/gdb/testsuite/gdb.fortran/nested-funcs.exp b/gdb/testsuite/gdb.fortran/nested-funcs.exp index ea3d66685be..237e09ed009 100755 --- a/gdb/testsuite/gdb.fortran/nested-funcs.exp +++ b/gdb/testsuite/gdb.fortran/nested-funcs.exp @@ -25,7 +25,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" continue } diff --git a/gdb/testsuite/gdb.fortran/printing-types.exp b/gdb/testsuite/gdb.fortran/printing-types.exp index 3a8e02fea12..0ba07f6c1ff 100644 --- a/gdb/testsuite/gdb.fortran/printing-types.exp +++ b/gdb/testsuite/gdb.fortran/printing-types.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} { return -1 } -if {![fortran_runto_main]} then { +if {![fortran_runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.fortran/ptr-indentation.exp b/gdb/testsuite/gdb.fortran/ptr-indentation.exp index 98378342957..daf5bd53550 100644 --- a/gdb/testsuite/gdb.fortran/ptr-indentation.exp +++ b/gdb/testsuite/gdb.fortran/ptr-indentation.exp @@ -22,7 +22,7 @@ if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} { return -1 } -if {![fortran_runto_main]} then { +if {![fortran_runto_main]} { return -1 } diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp index cc2454858a0..6751b50a43d 100644 --- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp @@ -24,7 +24,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { return -1 } -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp b/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp index aa7f5d1ebde..d458e1adfc4 100644 --- a/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp +++ b/gdb/testsuite/gdb.fortran/short-circuit-argument-list.exp @@ -25,7 +25,7 @@ if {[prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}]} { return -1 } -if {![runto [gdb_get_line_number "post_truth_table_init"]]} then { +if {![runto [gdb_get_line_number "post_truth_table_init"]]} { perror "couldn't run to breakpoint post_truth_table_init" return } diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp index b282c5dd7c9..88d47f91e77 100644 --- a/gdb/testsuite/gdb.fortran/subarray.exp +++ b/gdb/testsuite/gdb.fortran/subarray.exp @@ -30,7 +30,7 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} { # Avoid shared lib symbols. gdb_test_no_output "set auto-solib-add off" -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return } diff --git a/gdb/testsuite/gdb.fortran/type-kinds.exp b/gdb/testsuite/gdb.fortran/type-kinds.exp index 47b788bf134..e481ad3b38d 100644 --- a/gdb/testsuite/gdb.fortran/type-kinds.exp +++ b/gdb/testsuite/gdb.fortran/type-kinds.exp @@ -101,7 +101,7 @@ proc test_old_star_type_sizes {} { clean_restart -if [set_lang_fortran] then { +if {[set_lang_fortran]} { test_basic_parsing_of_type_kinds test_parsing_invalid_type_kinds test_old_star_type_sizes diff --git a/gdb/testsuite/gdb.fortran/types.exp b/gdb/testsuite/gdb.fortran/types.exp index 594276f3a7b..eac667646ac 100644 --- a/gdb/testsuite/gdb.fortran/types.exp +++ b/gdb/testsuite/gdb.fortran/types.exp @@ -106,7 +106,7 @@ gdb_reinitialize_dir $srcdir/$subdir gdb_test "set print sevenbit-strings" "" -if [set_lang_fortran] then { +if {[set_lang_fortran]} { test_primitive_types_known test_default_types test_integer_literal_types_accepted diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp index 5b3a680c9f7..36ba0b405e3 100644 --- a/gdb/testsuite/gdb.fortran/vla-value.exp +++ b/gdb/testsuite/gdb.fortran/vla-value.exp @@ -130,7 +130,7 @@ gdb_test "print vla1(9, 9, 9)" "no such vector element \\\(vector not allocated\ # Try to assign VLA to user variable clean_restart ${testfile} -if ![fortran_runto_main] then { +if {![fortran_runto_main]} { perror "couldn't run to main" return }