diff options
author | Kito Cheng <kito.cheng@sifive.com> | 2020-10-05 14:01:04 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2020-11-06 11:08:52 +0800 |
commit | 65e82636bcdb72a878c2e53943e71b15dd9fb22d (patch) | |
tree | 27d7ab7a0566078eb8d660092c1804a998c17ba3 /gcc/testsuite/lib | |
parent | f72af3af8d526793e4927daf44ae0611c3d0cc85 (diff) | |
download | gcc-65e82636bcdb72a878c2e53943e71b15dd9fb22d.zip gcc-65e82636bcdb72a878c2e53943e71b15dd9fb22d.tar.gz gcc-65e82636bcdb72a878c2e53943e71b15dd9fb22d.tar.bz2 |
PR target/96307: Fix KASAN option checking.
- Disable kasan if target is unsupported and -fasan-shadow-offset= is not
given, no matter `--param asan-stack=1` is given or not.
- Moving KASAN option checking testcase to gcc.dg, those testcase could be
useful for all other target which not support asan.
- Verifed on riscv and x86.
gcc/ChangeLog:
PR target/96307
* toplev.c (process_options): Remove param_asan_stack checking for kasan
option checking.
gcc/testsuite/ChangeLog:
PR target/96307
* gcc.dg/pr96307.c: New.
* gcc.target/riscv/pr96260.c: Move this test case from here to ...
* gcc.dg/pr96260.c: ... here.
* gcc.target/riscv/pr91441.c: Move this test case from here to ...
* gcc.dg/pr91441.c: ... here.
* lib/target-supports.exp (check_effective_target_no_fsanitize_address):
New proc.
Diffstat (limited to 'gcc/testsuite/lib')
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 8439720..08e96e1 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -10582,3 +10582,14 @@ proc check_effective_target_movdir { } { } } "-mmovdiri -mmovdir64b" ] } + +# Return 1 if target is not support address sanitize, 1 otherwise. + +proc check_effective_target_no_fsanitize_address {} { + if ![check_no_compiler_messages fsanitize_address executable { + int main (void) { return 0; } + }] { + return 1; + } + return 0; +} |