diff options
author | Tom de Vries <tdevries@suse.de> | 2020-05-02 10:56:48 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-05-02 10:56:48 +0200 |
commit | 5beb4d17717570c28e9bf290c64428fda65095b9 (patch) | |
tree | a30003aad308f65189e11812559edba5cb2012a9 /gdb/testsuite/gdb.arch/i386-mpx-map.exp | |
parent | 8caf140db24116e8874099291a7a48644c368ab6 (diff) | |
download | gdb-5beb4d17717570c28e9bf290c64428fda65095b9.zip gdb-5beb4d17717570c28e9bf290c64428fda65095b9.tar.gz gdb-5beb4d17717570c28e9bf290c64428fda65095b9.tar.bz2 |
[gdb/testsuite] Fix i386-mpx.exp compilation warnings
When running test-case gdb.arch/i386-mpx.exp with gcc-10, we get:
...
Running src/gdb/testsuite/gdb.arch/i386-mpx.exp ...
gdb compile failed, xgcc: warning: switch '-mmpx' is no longer supported
xgcc: warning: switch '-fcheck-pointer-bounds' is no longer supported
...
The test-case uses a combination of options, -mmpx and -fcheck-pointer-bounds.
The -fcheck-pointer-bounds option requires the -mmpx option:
...
$ gcc -fcheck-pointer-bounds ~/hello.c
hello.c:1:0: warning: Pointer Checker requires MPX support on this target. \
Use -mmpx options to enable MPX.
#include <stdio.h>
cc1: error: ‘-fcheck-pointer-bounds’ is not supported for this target
...
Both options is no longer supported in gcc-9.
Fix the warnings by testing if the option combination is supported.
Tested on x86_64-linux, with gcc-7.5.0 and gcc-10.0.1.
gdb/testsuite/ChangeLog:
2020-05-02 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (supports_mpx_check_pointer_bounds): New proc.
* gdb.arch/i386-mpx-call.exp: Use supports_mpx_check_pointer_bounds.
* gdb.arch/i386-mpx-map.exp: Same.
* gdb.arch/i386-mpx-sigsegv.exp: Same.
* gdb.arch/i386-mpx-simple_segv.exp: Same.
* gdb.arch/i386-mpx.exp: Same.
Diffstat (limited to 'gdb/testsuite/gdb.arch/i386-mpx-map.exp')
-rw-r--r-- | gdb/testsuite/gdb.arch/i386-mpx-map.exp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/i386-mpx-map.exp b/gdb/testsuite/gdb.arch/i386-mpx-map.exp index 3cde42f..995aaa1 100644 --- a/gdb/testsuite/gdb.arch/i386-mpx-map.exp +++ b/gdb/testsuite/gdb.arch/i386-mpx-map.exp @@ -23,6 +23,10 @@ if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { standard_testfile +if { ![supports_mpx_check_pointer_bounds] } { + return -1 +} + set comp_flags "-mmpx -fcheck-pointer-bounds -I${srcdir}/../nat/" if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ |