mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-12 20:03:45 +08:00
3c8ea5be24
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.
35 lines
596 B
C
35 lines
596 B
C
/* pr 13536 */
|
|
|
|
static void param_reg (register signed char pr_char,
|
|
register unsigned char pr_uchar,
|
|
register short pr_short,
|
|
register unsigned short pr_ushort);
|
|
|
|
int bkpt;
|
|
|
|
int
|
|
main ()
|
|
{
|
|
|
|
bkpt = 0;
|
|
param_reg (120, 130, 32000, 33000);
|
|
param_reg (-120, 130, -32000, 33000);
|
|
|
|
return 0;
|
|
}
|
|
|
|
static void dummy () {}
|
|
|
|
static void
|
|
param_reg(register signed char pr_char,
|
|
register unsigned char pr_uchar,
|
|
register short pr_short,
|
|
register unsigned short pr_ushort)
|
|
{
|
|
bkpt = 1;
|
|
dummy ();
|
|
pr_char = 1;
|
|
pr_uchar = pr_short = pr_ushort = 1;
|
|
dummy ();
|
|
}
|