From: Guinevere Larsen Date: Thu, 20 Jul 2023 09:47:50 +0000 (+0200) Subject: gdb/testsuite: Fix many errors in gdb.reverse with clang X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a47dae3f3a6265576a876c9d6229c8e1e29d5636;p=binutils-gdb.git gdb/testsuite: Fix many errors in gdb.reverse with clang Clang does not add line information for lines that only contain a closing } in functions. Many tests in the gdb.reverse folder set a breakpoint in that line, but don't seem to use information available after the return statement is executed, so this commit moves the breakpoint to the previous line, where the return statement is. Approved-By: Tom Tromey --- diff --git a/gdb/testsuite/gdb.reverse/break-reverse.c b/gdb/testsuite/gdb.reverse/break-reverse.c index 5f54a8f2bd7..4ae459f1bba 100644 --- a/gdb/testsuite/gdb.reverse/break-reverse.c +++ b/gdb/testsuite/gdb.reverse/break-reverse.c @@ -33,5 +33,5 @@ int main () { xyz = 0; /* break in main */ foo (); - return (xyz == 2 ? 0 : 1); -} /* end of main */ + return (xyz == 2 ? 0 : 1); /* end of main */ +} diff --git a/gdb/testsuite/gdb.reverse/finish-reverse.c b/gdb/testsuite/gdb.reverse/finish-reverse.c index 609a14568a5..cc056ecfa8a 100644 --- a/gdb/testsuite/gdb.reverse/finish-reverse.c +++ b/gdb/testsuite/gdb.reverse/finish-reverse.c @@ -123,6 +123,6 @@ int main (int argc, char **argv) testval.double_testval = 3.14159265358979323846; /* float_checkpoint */ double_resultval = double_func (); main_test = 1; /* double_checkpoint */ - return 0; -} /* end of main */ + return 0; /* end of main */ +} diff --git a/gdb/testsuite/gdb.reverse/watch-reverse.c b/gdb/testsuite/gdb.reverse/watch-reverse.c index 8b7d1be0db5..e1b024af10b 100644 --- a/gdb/testsuite/gdb.reverse/watch-reverse.c +++ b/gdb/testsuite/gdb.reverse/watch-reverse.c @@ -206,6 +206,6 @@ int main () func4 (); - return 0; -} /* end of main */ + return 0; /* end of main */ +}