Fix gdb.base/structs2.exp with Clang
authorPedro Alves <palves@redhat.com>
Thu, 2 Jul 2020 18:32:40 +0000 (19:32 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 3 Jul 2020 14:01:22 +0000 (15:01 +0100)
commit3c8ea5be24ecc76600b6cea36240449a84c0fc22
treec79f9c13ca696e4b30454ed8c3e3307bbf55e9d5
parentbf90c83acca6736f451807d3e231b53dc02bc57b
Fix gdb.base/structs2.exp with Clang

gdb.base/structs2.exp fails to run with Clang, because of:

 gdb compile failed, /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/structs2.c:16:14: warning:
       implicit conversion from 'int' to 'signed char' changes value from 130 to
       -126 [-Wconstant-conversion]
   param_reg (130, 120, 33000, 32000);
   ~~~~~~~~~  ^~~
 /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/structs2.c:16:24: warning:
       implicit conversion from 'int' to 'short' changes value from 33000 to
       -32536 [-Wconstant-conversion]
   param_reg (130, 120, 33000, 32000);
   ~~~~~~~~~            ^~~~~
 2 warnings generated.

 === gdb Summary ===

 # of untested testcases         1

Fix it by passing actual negative numbers.

gdb/testsuite/ChangeLog:

* gdb.base/structs2.c (main): Adjust second parem_reg call to
explicitly write negative numbers.
* gdb.base/structs2.exp: Adjust expected output.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/structs2.c
gdb/testsuite/gdb.base/structs2.exp