From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id B0BC9395BC14 for ; Wed, 2 Jun 2021 09:43:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B0BC9395BC14 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32c.google.com with SMTP id n17-20020a7bc5d10000b0290169edfadac9so3359337wmk.1 for ; Wed, 02 Jun 2021 02:43:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=BFv8j6uJPJKqL+U4LERJ4tu0IQdBllGtSnCjUKYXHi4=; b=NIehhZbQxSNMVbkc3P0qp2605hWwKGJuGZE00tcAToeVb10xf1sf3zHBDrQ8s+xrFP KgT6+gQAwEi9EhklFhZoI5SeMWFzy+zquWPEJCnPfNYvfXirQeqVemUThZMA+dl/fmfa iznMcYyLGSS9WMfdgv2KfdwlVGlcvgVyXxgQbcG6ahcTb177di8MeTjDjA//2wJ/VcQC +k9gSLInbQUPq5zEue5m7u1wZ5zxglPOUk1IVZAY4pjG7XeG5H6hRbGrFbmmlsgHTMiu n5GhENqquRvrNoKqprEtZpOkfDT0HtaTgoFb8Uf9GxZU/UfPuvs6YBYMZS4Cbv1sUDwy TbCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BFv8j6uJPJKqL+U4LERJ4tu0IQdBllGtSnCjUKYXHi4=; b=Q4tt5Xvzcy8YZBe5l6k585aDWW4y7CXmsxY9aMd24XG4AakXr6bJ0p09+2aPK6ZOZR bUtmza7W4XHY1R5PdJTdbnBi3fTSGAWfVXmQzQQnkaQJF9BNCVwwjvhNbwr+jZ8nJxiy Mn6ZA2WdK62KxTYjsCbJQQBuKNO/tZL4n+byhUk7wsL/4j8BTK6rvGIIcGncLhsSIN3G cw4FqHBHJ8RLnfUQ0AbCOlY0A2ITiblVuh/lbKEyHSlV+LLojZkwqNPAvZWdPMX+Moo2 aXCCNHDEuqxa7jaNHPQWamRDe4kjiC9wg+4PGmxwM0RVLzjT0FiuceOvWMcKg3t5dTbR giNw== X-Gm-Message-State: AOAM5310cNCdlkvHcOsJn9XiV6DiyJO1/oAFut3wehu4CCRMGTs4f++D kTzvX2BcJs1OTRP710niQ2J+ww== X-Google-Smtp-Source: ABdhPJx/clS9dQHruylEKhW0kMC0bkKgqeb1Rza1w6jSF4w8nSba5c7btVcb6DYg5ZYIxRXH1L5dOQ== X-Received: by 2002:a1c:e343:: with SMTP id a64mr10566741wmh.114.1622626982876; Wed, 02 Jun 2021 02:43:02 -0700 (PDT) Received: from localhost (host109-151-46-70.range109-151.btcentralplus.com. [109.151.46.70]) by smtp.gmail.com with ESMTPSA id w8sm6525511wre.70.2021.06.02.02.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 02:43:02 -0700 (PDT) Date: Wed, 2 Jun 2021 10:43:01 +0100 From: Andrew Burgess To: "Kumar N, Bhuvanendra" Cc: "gdb-patches@sourceware.org" , "George, Jini Susan" , "Achra, Nitika" , "Sharma, Alok Kumar" , "E, Nagajyothi" , "Tomar, Sourabh Singh" Subject: Re: [PATCH] [gdb.fortran] Add type info of formal parameter for clang in ptype-on-functions.exp Message-ID: <20210602094301.GK2672@embecosm.com> References: <20210421161301.GK2610@embecosm.com> <20210430121400.GG2364578@embecosm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 10:31:34 up 13 days, 23:15, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 02 Jun 2021 09:43:14 -0000 * Kumar N, Bhuvanendra [2021-05-26 07:59:08 +0000]: > [AMD Official Use Only - Internal Distribution Only] > > Hi all, > > Gentle Ping 2! > > Please let me know if any other details are required, thanks Hi, Thanks for your patience, sorry to have taken so long to get back to you. Below is a patch more inline with how I think cases like this should be addressed. The difference to the approach you have taken is that, instead of just having two code paths, and in each path duplicating all of the tests, I use compiler checks to setup variables that are then used to tweak the expected output patterns. The benefit I see is that if common parts of the output change, we only need to update one pattern, and if any extra tests are added then there will be less chance of the new test only being added along one path by mistake. The only reason I didn't just commit this is that I think I'm not getting the same output as you are, you'll notice that some of the tests in this commit have setup_kfail, these are all the tests where I'm seeing different output to you. Would you be willing to take this commit and see if you can finish this off so that it meets your needs? Thanks, Andrew --- diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp index 14f522d6d42..772edc7e8a9 100644 --- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp @@ -29,23 +29,54 @@ if ![fortran_runto_main] then { continue } +set integer4 [fortran_int4] +set logical4 [fortran_logical4] +set integer8 [fortran_int8] + +if {[test_compiler_info {clang-*}]} { + set some_module_class_type "Type number" + set some_module_aux_info ", $integer8 \\(10\\)" +} else { + set some_module_class_type "Type __class_some_module_Number(_t)?" + set some_module_aux_info "" +} + +if {[test_compiler_info {clang-*}]} { + setup_kfail *-*-* "gets a pointer for some reason" +} gdb_test "ptype some_module::get_number" \ - "type = integer\\(kind=4\\) \\(Type __class_some_module_Number(_t)?\\)" + "type = $integer4 \\(${some_module_class_type}${some_module_aux_info}\\)" gdb_test "ptype some_module::set_number" \ - "type = void \\(Type __class_some_module_Number(_t)?, integer\\(kind=4\\)\\)" + "type = void \\(${some_module_class_type}, $integer4${some_module_aux_info}\\)" +if {[test_compiler_info {clang-*}]} { + setup_kfail *-*-* "gets a pointer for some reason" +} gdb_test "ptype is_bigger" \ - "type = logical\\(kind=4\\) \\(integer\\(kind=4\\), integer\\(kind=4\\)\\)" + "type = $logical4 \\($integer4, $integer4\\)" gdb_test "ptype say_numbers" \ - "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)" + "type = void \\($integer4, $integer4, $integer4\\)" +set fun_ptr_arg "$integer4" +if {[test_compiler_info {gcc-*}]} { + set fun_ptr_arg "REF TO -> \\( ${fun_ptr_arg} \\)" +} + +if {[test_compiler_info {clang-*}]} { + setup_kfail *-*-* "missing symbol" +} gdb_test "ptype fun_ptr" \ - "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)" + "type = PTR TO -> \\( $integer4 \\(\\) \\(${fun_ptr_arg}\\) \\)" gdb_test "ptype say_string" \ - "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)" + "type = void \\(character\[^,\]+, $integer8\\)" + +set say_array_artificial_first_arg "" +if {[test_compiler_info {clang-*}]} { + set say_array_artificial_first_arg "$integer8, " +} gdb_test "ptype say_array" \ - "type = void \\(integer\\(kind=4\\) \\(:,:\\)\\)" + "type = void \\(${say_array_artificial_first_arg}$integer4 \\(:,:\\)\\)"