Fix a couple gdb.dwarf2/ testcases with "clang -flto"
authorPedro Alves <pedro@palves.net>
Sun, 13 Sep 2020 17:17:18 +0000 (18:17 +0100)
committerPedro Alves <pedro@palves.net>
Sun, 13 Sep 2020 17:17:18 +0000 (18:17 +0100)
commitc49da0e466e1bcb6e1f363ea4a806cfd2c322cb0
tree4c282baf4e1e016f5ffa0e4a0bf0744e606d0019
parent6791b1172abea5867268c95a460aba1c66c2b6b0
Fix a couple gdb.dwarf2/ testcases with "clang -flto"

gdb.dwarf2/atomic-type.exp and gdb.dwarf2/ada-linkage-name.exp fail
when testing with "clang -flto" as compiler, like:

 $ make check TESTS="gdb.dwarf2/ada-linkage-name.exp" RUNTESTFLAGS="CC_FOR_TARGET='clang -flto'"

because with -flto, functions that aren't referenced anywhere are not
emitted in the final binary.  Fix it by adding uses of the functions.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/ada-linkage-name.c (main): Move to the bottom of the
file and add calls to first and second.
* gdb.dwarf2/atomic.c (main): Move to the bottom of the file and
add call to f.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/ada-linkage-name.c
gdb/testsuite/gdb.dwarf2/atomic.c