Skip gdb ifunc tests on targets that don't support this feature.
authorSandra Loosemore <sandra@codesourcery.com>
Wed, 3 Oct 2018 16:16:53 +0000 (09:16 -0700)
committerSandra Loosemore <sandra@codesourcery.com>
Wed, 3 Oct 2018 16:16:53 +0000 (09:16 -0700)
2018-10-03  Sandra Loosemore  <sandra@codesourcery.com>

* lib/gdb.exp (skip_ifunc_tests): New.
* gdb.base/gnu-ifunc.exp: Skip if no ifunc support.  Handle
other compile failures.
* gdb.compile/compile-ifunc.exp: Skip if no ifunc support.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/gnu-ifunc.exp
gdb/testsuite/gdb.compile/compile-ifunc.exp
gdb/testsuite/lib/gdb.exp

index 502c5bf0bbb65cce68ca06fc7e7d889218eb0f5e..49945931e294e7bd92f1c33f568925579472fba8 100644 (file)
@@ -1,3 +1,10 @@
+2018-10-03  Sandra Loosemore  <sandra@codesourcery.com>
+
+       * lib/gdb.exp (skip_ifunc_tests): New.
+       * gdb.base/gnu-ifunc.exp: Skip if no ifunc support.  Handle
+       other compile failures.
+       * gdb.compile/compile-ifunc.exp: Skip if no ifunc support.
+
 2018-10-01  Simon Marchi  <simon.marchi@ericsson.com>
 
        * gdb.arch/i386-avx512.exp: Fix setting of nr_regs based on
index d6ec6988a7d75668d06094414595652c5d401c29..322de5a604202fbe7e2ab86a1d526f12d3786279 100644 (file)
@@ -17,6 +17,10 @@ if {[skip_shlib_tests]} {
     return 0
 }
 
+if {[skip_ifunc_tests]} {
+    return 0
+}
+
 standard_testfile .c
 set staticexecutable ${testfile}-static
 set staticbinfile [standard_output_file ${staticexecutable}]
@@ -365,9 +369,10 @@ proc misc_tests {resolver_attr resolver_debug final_debug} {
 foreach_with_prefix resolver_attr {0 1} {
     foreach_with_prefix resolver_debug {0 1} {
        foreach_with_prefix final_debug {0 1} {
-           build $resolver_attr $resolver_debug $final_debug
-           misc_tests $resolver_attr $resolver_debug $final_debug
-           set-break $resolver_attr $resolver_debug $final_debug
+           if { [build $resolver_attr $resolver_debug $final_debug] != 0 } {
+               misc_tests $resolver_attr $resolver_debug $final_debug
+               set-break $resolver_attr $resolver_debug $final_debug
+           }
        }
     }
 }
index 979e39147e7f12f5f4947223deec6addcdb91684..bb3af4d753dc204c56b6ff2ce7f77f96534d3da0 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+if {[skip_ifunc_tests]} {
+    return 0
+}
+
 standard_testfile
 
 with_test_prefix "nodebug" {
index 9284291ccd99d62edc574e737c1d4b79a524b2d9..fbdb436e331d2d9d1fced3eb4612e6fed9c0e294 100644 (file)
@@ -2893,6 +2893,20 @@ gdb_caching_proc has_int128_cxx {
     return [gdb_int128_helper c++]
 }
 
+# Return true if the IFUNC feature is unsupported.
+gdb_caching_proc skip_ifunc_tests {
+    if [gdb_can_simple_compile ifunc {
+       extern void f_ ();
+       typedef void F (void);
+       F* g (void) { return &f_; }
+       void f () __attribute__ ((ifunc ("g")));
+    } object] {
+       return 0
+    } else {
+       return 1
+    }
+}
+
 # Return whether we should skip tests for showing inlined functions in
 # backtraces.  Requires get_compiler_info and get_debug_format.