aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/ada-linkage-name.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2020-09-13 18:17:18 +0100
committerPedro Alves <pedro@palves.net>2020-09-13 18:17:18 +0100
commitc49da0e466e1bcb6e1f363ea4a806cfd2c322cb0 (patch)
tree4c282baf4e1e016f5ffa0e4a0bf0744e606d0019 /gdb/testsuite/gdb.dwarf2/ada-linkage-name.c
parent6791b1172abea5867268c95a460aba1c66c2b6b0 (diff)
downloadgdb-c49da0e466e1bcb6e1f363ea4a806cfd2c322cb0.zip
gdb-c49da0e466e1bcb6e1f363ea4a806cfd2c322cb0.tar.gz
gdb-c49da0e466e1bcb6e1f363ea4a806cfd2c322cb0.tar.bz2
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.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/ada-linkage-name.c')
-rw-r--r--gdb/testsuite/gdb.dwarf2/ada-linkage-name.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.c b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.c
index adcb009..fe04147 100644
--- a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.c
+++ b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.c
@@ -15,13 +15,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-int
-main (void)
-{
- asm ("main_label: .globl main_label");
- return 0;
-}
-
/* First dummy function. */
int
@@ -39,3 +32,14 @@ second (char *x)
asm ("second_label: .globl second_label");
return 0;
}
+
+
+int
+main (void)
+{
+ asm ("main_label: .globl main_label");
+
+ first (0);
+ second (0);
+ return 0;
+}