[gdb/testsuite] Make inline-locals.c deterministic
authorTom de Vries <tdevries@suse.de>
Tue, 21 Jul 2020 08:25:42 +0000 (10:25 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 21 Jul 2020 08:25:42 +0000 (10:25 +0200)
commitf0f9e75a824dcd0053ae4e8f9aaf8056aa1a8bc5
tree12bb39412a36df27319712968329a786c12d679b
parentbd460ecb313d064e079acacfc1eba77c58684f98
[gdb/testsuite] Make inline-locals.c deterministic

When running testcase gdb.opt/inline-locals.exp on openSUSE Tumbleweed, I get:
...
(gdb) info locals^M
array = {0 <repeats 48 times>, 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 <repeats 64 times>}"

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-21  Tom de Vries  <tdevries@suse.de>

* gdb.opt/inline-locals.c (init_array): New func.
(func1): Use init_array.
* gdb.opt/inline-locals.exp: Update pattern.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.opt/inline-locals.c
gdb/testsuite/gdb.opt/inline-locals.exp