]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix gdb.base/list.exp with Clang
authorGary Benson <gbenson@redhat.com>
Tue, 6 Oct 2020 14:08:37 +0000 (15:08 +0100)
committerGary Benson <gbenson@redhat.com>
Tue, 6 Oct 2020 14:08:37 +0000 (15:08 +0100)
Two subtests of gdb.base/list.exp failed when built with Clang
because the unused function "unused" was optimized out.  This
commit adds __attribute__ ((used)) to both definitions.

gdb/testsuite/ChangeLog:

* gdb.base/list0.c (unused): Add __attribute__ ((used)).
* gdb.base/list1.c (unused): Likewise.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/list0.c
gdb/testsuite/gdb.base/list1.c

index f91c4dcbbf3ef8ed5338f86282546266b1d1ca9c..7484d6e3e657fce72cdd070789c8e4b2288427ab 100644 (file)
@@ -1,3 +1,8 @@
+2020-10-06  Gary Benson <gbenson@redhat.com>
+
+       * gdb.base/list0.c (unused): Add __attribute__ ((used)).
+       * gdb.base/list1.c (unused): Likewise.
+
 2020-10-06  Gary Benson <gbenson@redhat.com>
 
        * gdb.base/list-ambiguous0.c (ambiguous_var): Add
index 0255cf37e02c1d2be4b45f6b030de6ed4d46d03f..1e5b7c18ae2317dcfed8b5b1f4597ae207cb2dd4 100644 (file)
@@ -36,7 +36,7 @@ int main ()
     return 0;
 }
 
-static void
+static void __attribute__ ((used))
 unused ()
 {
     /* Not used for anything */
index a9f614f2f645d0ea724f7b671826916568cec742..d694495c3fbfba8aab73e9595c6187485d1c866d 100644 (file)
@@ -12,7 +12,7 @@ void bar (int x)
     long_line ();
 }
 
-static void
+static void __attribute__ ((used))
 unused ()
 {
     /* Not used for anything */