From patchwork Wed Feb 5 05:15:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sharma, Alok Kumar" X-Patchwork-Id: 37683 Received: (qmail 16692 invoked by alias); 5 Feb 2020 05:15:58 -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 16594 invoked by uid 89); 5 Feb 2020 05:15:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=Official X-HELO: NAM10-BN7-obe.outbound.protection.outlook.com Received: from mail-bn7nam10on2049.outbound.protection.outlook.com (HELO NAM10-BN7-obe.outbound.protection.outlook.com) (40.107.92.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 05 Feb 2020 05:15:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BTejCMXYrMbwT1HjVx0C8uLvf0lh3Lhaind01DjcsOO5JgKRFbdx54qy45eU9Xs/whvZjTUi2oWKbZRiDsYQ+o/O1DR1lw7YgEftXJRKzuvR4PWNsaeXOMbU29HsqzvzT1/CTQ9SrFGCE1XzU9mgEUoY4QZQUnTgd2DVZJsl5+cHXPppJ1iyHu840pkIj4oV1NGfSZaKy5TxCPY37BhHstE3lKI4PWtujdfoTqWBYfaaNwX5TCptoGo/1OWSAMEwC6YilV9XCWcAdxHmV31KbaxX1pbkFj5RdGtooqx7MuD/EagtATW/VwffNvsT8Ooqla9LGLfMxKk+lmOZuA8eUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gWagiF3dVJIGX51OSzA2dYp83FkR/s8GmnJ0IkOHO7I=; b=f+wqkEHFcCKDyW8fQvWvtrlEpT660jZ+Rbezdd7ni/HIiRTx+iby7HMUZv/RvSqeohblKGAVrZucj9rC+giLVW/fl6w3wbXmMlP68h9iGjfiIZm5/xaqkdVISY4lqIwyHr0KlMTYe98LgELkrYuAINfeoqtrmxRly3mbcZyhCTQ7QUdIkTA5W1ku78b4nr/uRWFKgrCtmiaSpohuPJGhtq+LFl3w7hEP+0gd2Wtj7MvTdixlufon9gUBhCR8lAU5RA/UyuqJi2toYHY7XBOeYiiVrAv4nq9WGzzuqTO4KyNj39dR9s18zB35EAvVh0Hn+D6CKBAsQ0RecpuAeq/deA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gWagiF3dVJIGX51OSzA2dYp83FkR/s8GmnJ0IkOHO7I=; b=kUR76TOwOI/chOYTQ+Ucr13vTeFy3CLFbnlKfIi1wVCIxDIEetolxZr094Xue5CEewj2HrgHZ9pDU7x7LnmcfwGxSR9qhUE/yBRgUbJv1/KyShPNy58wGxJQ3h/UAFCxwS23ONerAgh/Jst7+qa+iCGG1ATya1NUtVJ9S7sH1wY= Received: from DM6PR12MB3129.namprd12.prod.outlook.com (20.178.198.218) by DM6PR12MB3228.namprd12.prod.outlook.com (20.179.107.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2686.30; Wed, 5 Feb 2020 05:15:20 +0000 Received: from DM6PR12MB3129.namprd12.prod.outlook.com ([fe80::8db9:4846:593:c010]) by DM6PR12MB3129.namprd12.prod.outlook.com ([fe80::8db9:4846:593:c010%6]) with mapi id 15.20.2686.034; Wed, 5 Feb 2020 05:15:20 +0000 From: "Sharma, Alok Kumar" To: Andrew Burgess CC: "gdb-patches@sourceware.org" , "George, Jini Susan" , "Achra, Nitika" Subject: RE: [PATCH] Adding support to execute gdb.fortran for the flang compiler Date: Wed, 5 Feb 2020 05:15:19 +0000 Message-ID: References: <20200204182737.GC4020@embecosm.com> In-Reply-To: <20200204182737.GC4020@embecosm.com> msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_enabled: true msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_setdate: 2020-02-05T05:15:16Z msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_method: Standard msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_name: Internal Use Only - Unrestricted msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_actionid: 2a36ddae-f135-491e-b89f-0000809eab91 msip_label_76546daa-41b6-470c-bb85-f6f40f044d7f_contentbits: 0 authentication-results: spf=none (sender IP is ) smtp.mailfrom=AlokKumar.Sharma@amd.com; x-ms-exchange-transport-forked: True x-ms-oob-tlc-oobclassifiers: OLM:7219; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-messagedata: wAroo3syS13U1ZEewONQQsStF35/A8kGb51IXB82XmrvkefP4umPUYc+CkWaz1J1eEcvF7UK9WPzH9DMwyoPcCoOT1N/wKnRN/yOdL0IVKu4rLY5QCx8wccFTts9ykRgxfIWwJK6wdPxAJkRmYK5Qw== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: /ZG1UvUzMuJ3mE+1tNDGw1VFjNeLeXMeyKqv72IUCzbSvVvvyxsACoil5A0lKsOuqqXtu8HpqYg4I5EOUlmoFQ== [AMD Official Use Only - Internal Distribution Only] Thanks a lot Andrew. Regards, Alok -----Original Message----- From: Andrew Burgess Sent: Tuesday, February 4, 2020 11:58 PM To: Sharma, Alok Kumar Cc: gdb-patches@sourceware.org; George, Jini Susan ; Achra, Nitika Subject: Re: [PATCH] Adding support to execute gdb.fortran for the flang compiler [CAUTION: External Email] * Sharma, Alok Kumar [2020-02-04 16:17:13 +0000]: > Hi All, > > Problem Description: > > When gdb.fortran testsuite is executed with the flang compiler, many > tests fail. For an example below test case $ make check RUNTESTFLAGS=' > CC_FOR_TARGET="flang"' \ > TESTS="gdb.fortran/vla-datatypes.exp" > Test case fails for below testpoint > gdb_test "ptype intvla" "type = $int, allocatable \\\(11,22,33\\\)" > > Root cause: > > Output from gdb.log > ptype intvla^M > type = integer(kind=4), allocatable (11,22,33)^M > (gdb) FAIL: gdb.fortran/vla-datatypes.exp: ptype intvla Though the > actual output is correct, due to the wrong value of $int the output is > identified as FAIL. > Please check the below code form "lib/fortran.exp". > -------------------------------------- > proc fortran_int4 {} { > if {[test_compiler_info {gcc-4-[012]-*}]} { > return "int4" > } elseif {[test_compiler_info {gcc-*}]} { > return "integer\\(kind=4\\)" > } elseif {[test_compiler_info {icc-*}]} { > return "INTEGER\\(4\\)" > } else { > return "unknown" > } > } > -------------------------------------- > As evident from code for the flang compiler $int is derived as "unknown". > > Resolution: > > To fix this, support for the flang is added in file lib/fortran.exp > > Testing: > > - There was no regression seen > > Please let me know your comments. Thank you for this. There is a copyright assignment in place for AMD to GDB, so I went ahead and committed this. The exact patch I pushed is included below. Thanks again, Andrew --- gdb/fortran: Allow for using Flang in Fortran testing In lib/fortran.exp, in the helper function fortran_int4, there is currently no support for the LLVM Fortran compiler, Flang. As a result we return the default pattern 'unknown' to match against all 4-byte integer types, which causes many tests to fail. The same is true for all of the other helper functions related to finding a suitable type pattern. This commit adds support for Flang. There should be no change when testing with gfortran. gdb/testsuite/ChangeLog: * lib/fortran.exp (fortran_int4): Handle clang. (fortran_int8): Likewise. (fortran_real4): Likewise. (fortran_real8): Likewise. (fortran_complex4): Likewise. (fortran_logical4): Likewise. (fortran_character1): Likewise. Change-Id: Ife0d9828f78361fbd992bf21af746042b017dafc --- gdb/testsuite/ChangeLog | 10 ++++++++++ gdb/testsuite/lib/fortran.exp | 21 ++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) if {[test_compiler_info {gcc-4-[012]-*}]} { return "int8" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "integer\\(kind=8\\)" } elseif {[test_compiler_info {icc-*}]} { return "INTEGER\\(8\\)" @@ -56,7 +58,8 @@ proc fortran_int8 {} { proc fortran_real4 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "real4" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "real\\(kind=4\\)" } elseif {[test_compiler_info {icc-*}]} { return "REAL\\(4\\)" @@ -68,7 +71,8 @@ proc fortran_real4 {} { proc fortran_real8 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "real8" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "real\\(kind=8\\)" } elseif {[test_compiler_info {icc-*}]} { return "REAL\\(8\\)" @@ -80,7 +84,8 @@ proc fortran_real8 {} { proc fortran_complex4 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "complex4" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "complex\\(kind=4\\)" } elseif {[test_compiler_info {icc-*}]} { return "COMPLEX\\(4\\)" @@ -92,7 +97,8 @@ proc fortran_complex4 {} { proc fortran_logical4 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "logical4" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "logical\\(kind=4\\)" } elseif {[test_compiler_info {icc-*}]} { return "LOGICAL\\(4\\)" @@ -104,7 +110,8 @@ proc fortran_logical4 {} { proc fortran_character1 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "character1" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "character\\(kind=1\\)" } elseif {[test_compiler_info {icc-*}]} { return "CHARACTER\\(1\\)" -- 2.14.5 diff --git a/gdb/testsuite/lib/fortran.exp b/gdb/testsuite/lib/fortran.exp index 0c2627d82a9..54f32936773 100644 --- a/gdb/testsuite/lib/fortran.exp +++ b/gdb/testsuite/lib/fortran.exp @@ -32,7 +32,8 @@ proc set_lang_fortran {} { proc fortran_int4 {} { if {[test_compiler_info {gcc-4-[012]-*}]} { return "int4" - } elseif {[test_compiler_info {gcc-*}]} { + } elseif {[test_compiler_info {gcc-*}] + || [test_compiler_info {clang-*}]} { return "integer\\(kind=4\\)" } elseif {[test_compiler_info {icc-*}]} { return "INTEGER\\(4\\)" @@ -44,7 +45,8 @@ proc fortran_int4 {} { proc fortran_int8 {} {