From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36636 invoked by alias); 4 Mar 2020 08:48:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 35718 invoked by uid 89); 4 Mar 2020 08:48:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.1 spammy=2110, 03-03-2020 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Mar 2020 08:48:25 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E485BAED7; Wed, 4 Mar 2020 08:48:22 +0000 (UTC) Subject: [gdb/testsuite] Fix missing uint8_t in gdb.fortran/logical.exp To: Andrew Burgess , "Sharma, Alok Kumar" Cc: "gdb-patches@sourceware.org" References: <20200302182152.12819-1-andrew.burgess@embecosm.com> <20200303182143.GX3317@embecosm.com> From: Tom de Vries Message-ID: <2f60fb40-80d1-b8ea-7f77-a49531de0eee@suse.de> Date: Wed, 04 Mar 2020 08:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200303182143.GX3317@embecosm.com> Content-Type: multipart/mixed; boundary="------------E1C4F9E1CD571717344DBD82" X-IsSubscribed: yes X-SW-Source: 2020-03/txt/msg00080.txt This is a multi-part message in MIME format. --------------E1C4F9E1CD571717344DBD82 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 512 [ was: Re: [PATCHv2] gdb/fortran: Fix printing of logical true values for Flang ] On 03-03-2020 19:21, Andrew Burgess wrote: > * Sharma, Alok Kumar [2020-03-03 04:47:20 +0000]: > >> I strongly agree and accept your comment. Please let me know if >> patch need to be updated by me? In case you have already >> incorporated the comments, please push it. > > I pushed this change. I'm running into trouble with the test-case. Attached patch fixes that. OK for trunk? Thanks, - Tom --------------E1C4F9E1CD571717344DBD82 Content-Type: text/x-patch; charset=UTF-8; name="0001-gdb-testsuite-Fix-missing-uint8_t-in-gdb.fortran-logical.exp.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="0001-gdb-testsuite-Fix-missing-uint8_t-in-gdb.fortran-logica"; filename*1="l.exp.patch" Content-length: 1881 [gdb/testsuite] Fix missing uint8_t in gdb.fortran/logical.exp With test-case gdb.fortran/logical.exp, I run into: ... (gdb) PASS: gdb.fortran/logical.exp: var=l: get hexadecimal valueof "&l" set *((uint8_t *) 0x7fffffffd2bc) = 0xff^M No symbol "uint8_t" in current context.^M (gdb) FAIL: gdb.fortran/logical.exp: var=l: byte 0: set contents of byte at offset 0 ... Fix this by using the fortran-native type character instead. Tested on x86_64-linux, with gcc 7.5.0 and clang 5.0.2. gdb/testsuite/ChangeLog: 2020-03-04 Tom de Vries * gdb.fortran/logical.f90: Define variable with character type. * gdb.fortran/logical.exp: Use character type instead of uint8_t. --- gdb/testsuite/gdb.fortran/logical.exp | 2 +- gdb/testsuite/gdb.fortran/logical.f90 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.fortran/logical.exp b/gdb/testsuite/gdb.fortran/logical.exp index 96e6f8f955..324714fa49 100644 --- a/gdb/testsuite/gdb.fortran/logical.exp +++ b/gdb/testsuite/gdb.fortran/logical.exp @@ -43,7 +43,7 @@ foreach_with_prefix var { l l1 l2 l4 l8 } { for { set i 0 } { $i < $len } { incr i } { with_test_prefix "byte $i" { - gdb_test_no_output "set *((uint8_t *) ${addr}) = 0xff" \ + gdb_test_no_output "set *((character *) ${addr}) = 0xff" \ "set contents of byte at offset $i" gdb_test "p l" " = \\.TRUE\\." incr addr diff --git a/gdb/testsuite/gdb.fortran/logical.f90 b/gdb/testsuite/gdb.fortran/logical.f90 index aea78e7089..175dfd1fc5 100644 --- a/gdb/testsuite/gdb.fortran/logical.f90 +++ b/gdb/testsuite/gdb.fortran/logical.f90 @@ -21,10 +21,12 @@ program test logical (kind=2) :: l2 logical (kind=4) :: l4 logical (kind=8) :: l8 + character :: c l = .TRUE. l1 = .TRUE. l2 = .TRUE. l4 = .TRUE. l8 = .TRUE. l = .FALSE. ! stop-here + c = 'a' end --------------E1C4F9E1CD571717344DBD82--