aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2020-07-02 19:32:40 +0100
committerPedro Alves <palves@redhat.com>2020-07-03 15:01:22 +0100
commit3c8ea5be24ecc76600b6cea36240449a84c0fc22 (patch)
treec79f9c13ca696e4b30454ed8c3e3307bbf55e9d5
parentbf90c83acca6736f451807d3e231b53dc02bc57b (diff)
downloadgdb-3c8ea5be24ecc76600b6cea36240449a84c0fc22.zip
gdb-3c8ea5be24ecc76600b6cea36240449a84c0fc22.tar.gz
gdb-3c8ea5be24ecc76600b6cea36240449a84c0fc22.tar.bz2
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.
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/structs2.c2
-rw-r--r--gdb/testsuite/gdb.base/structs2.exp2
3 files changed, 8 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 79c1208..983c431 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2020-07-03 Pedro Alves <palves@redhat.com>
+ * gdb.base/structs2.c (main): Adjust second parem_reg call to
+ explicitly write negative numbers.
+ * gdb.base/structs2.exp: Adjust expected output.
+
+2020-07-03 Pedro Alves <palves@redhat.com>
+
* gdb.base/charset.c (init_string): Change all char parameters to
unsigned char parameters.
diff --git a/gdb/testsuite/gdb.base/structs2.c b/gdb/testsuite/gdb.base/structs2.c
index 7c8be03..aac7bce 100644
--- a/gdb/testsuite/gdb.base/structs2.c
+++ b/gdb/testsuite/gdb.base/structs2.c
@@ -13,7 +13,7 @@ main ()
bkpt = 0;
param_reg (120, 130, 32000, 33000);
- param_reg (130, 120, 33000, 32000);
+ param_reg (-120, 130, -32000, 33000);
return 0;
}
diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
index 8a7d9c6..5722be3 100644
--- a/gdb/testsuite/gdb.base/structs2.exp
+++ b/gdb/testsuite/gdb.base/structs2.exp
@@ -49,5 +49,5 @@ if [test_compiler_info gcc-3-*] {
setup_xfail hppa*-* gcc/15860
}
gdb_test "continue" \
- ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
+ ".*pr_char=-120.*pr_uchar=130.*pr_short=-32000.*pr_ushort=33000.*bkpt = 1.*" \
"structs2 continue2"