aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.dwarf2/ada-linkage-name.c18
-rw-r--r--gdb/testsuite/gdb.dwarf2/atomic.c17
3 files changed, 27 insertions, 15 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 24a58ad..0744c1e 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,12 @@
2020-09-13 Pedro Alves <pedro@palves.net>
+ * 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.
+
+2020-09-13 Pedro Alves <pedro@palves.net>
+
* gdb.mi/mi-break-qualified.cc: New file.
* gdb.mi/mi-break-qualified.exp: New file.
* lib/mi-support.exp (mi_create_breakpoint_multi)
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;
+}
diff --git a/gdb/testsuite/gdb.dwarf2/atomic.c b/gdb/testsuite/gdb.dwarf2/atomic.c
index 1e279a4..8929989 100644
--- a/gdb/testsuite/gdb.dwarf2/atomic.c
+++ b/gdb/testsuite/gdb.dwarf2/atomic.c
@@ -15,20 +15,21 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* Dummy main function. */
-
+/* dummy f function, DWARF will describe arguments and type differently. */
int
-main (void)
+f (char *x)
{
- asm ("main_label: .globl main_label");
+ asm ("f_label: .globl f_label");
return 0;
}
-/* dummy f function, DWARF will describe arguments and type differently. */
+/* Dummy main function. */
+
int
-f (char *x)
+main (void)
{
- asm ("f_label: .globl f_label");
+ asm ("main_label: .globl main_label");
+
+ f (0);
return 0;
}
-