From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id D8CC03858D38 for ; Tue, 21 Jul 2020 08:26:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D8CC03858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 981EEAD18 for ; Tue, 21 Jul 2020 08:26:14 +0000 (UTC) Date: Tue, 21 Jul 2020 10:26:06 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Make inline-locals.c deterministic Message-ID: <20200721082605.GA14238@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, 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: Tue, 21 Jul 2020 08:26:10 -0000 Hi, When running testcase gdb.opt/inline-locals.exp on openSUSE Tumbleweed, I get: ... (gdb) info locals^M array = {0 , 15775231, 0, 194, 0, -11497, 32767, 4199061, \ 0, 0, 0, 0, 0, 4198992, 0, 4198432, 0}^M (gdb) FAIL: gdb.opt/inline-locals.exp: info locals above bar 2 ... Fix this by: - completely initializing array before printing any value - updating the pattern to match "array = {0 }" Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Make inline-locals.c deterministic gdb/testsuite/ChangeLog: 2020-07-21 Tom de Vries * gdb.opt/inline-locals.c (init_array): New func. (func1): Use init_array. * gdb.opt/inline-locals.exp: Update pattern. --- gdb/testsuite/gdb.opt/inline-locals.c | 9 +++++++++ gdb/testsuite/gdb.opt/inline-locals.exp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.opt/inline-locals.c b/gdb/testsuite/gdb.opt/inline-locals.c index 8fb91946fa..143a09ebc1 100644 --- a/gdb/testsuite/gdb.opt/inline-locals.c +++ b/gdb/testsuite/gdb.opt/inline-locals.c @@ -29,9 +29,18 @@ volatile int *array_p; void bar(void); +void +init_array (int *array, int n) +{ + int i; + for (i = 0; i < n; ++i) + array[i] = 0; +} + inline ATTR int func1(int arg1) { int array[64]; + init_array (array, 64); array_p = array; array[0] = result; array[1] = arg1; diff --git a/gdb/testsuite/gdb.opt/inline-locals.exp b/gdb/testsuite/gdb.opt/inline-locals.exp index 8104b0f5b7..841f177209 100644 --- a/gdb/testsuite/gdb.opt/inline-locals.exp +++ b/gdb/testsuite/gdb.opt/inline-locals.exp @@ -43,7 +43,7 @@ if { ! $no_frames } { "backtrace from bar 2" gdb_test "up" "#1 .*func1 .* at .*" "up from bar 2" gdb_test "info frame" ".*inlined into frame.*" "func1 inlined 2" - set pass_re "array = {$decimal, \[^\r\n\]*}" + set pass_re "array = \\{0 \\}" set kfail_re [multi_line $pass_re \ "array = { }"] gdb_test_multiple "info locals" "info locals above bar 2" {