libsanitizer: Add tests
authorMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 25 Nov 2020 16:31:49 +0000 (16:31 +0000)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Wed, 25 Nov 2020 16:39:09 +0000 (16:39 +0000)
commita47850552a0a25db7793a4eaf4859d43368a8b65
treeebbd855db061d8df99250353a99db288e881a50a
parent93a732514865f3607cc01f5c5b078f63580ef4b1
libsanitizer:  Add tests

Only interesting thing here is that we have to make sure the tagging mechanism
is deterministic to avoid flaky tests.

gcc/testsuite/ChangeLog:

* c-c++-common/ubsan/sanitize-recover-7.c: Update error message format.
* lib/asan-dg.exp (asan_link_flags): Implement as a helper
function asan_link_flags_1 which asan_link_flags and
hwasan_link_flags use.
(asan_link_flags_1): Parametrised version of asan_link_flags.
* c-c++-common/hwasan/aligned-alloc.c: New test.
* c-c++-common/hwasan/alloca-array-accessible.c: New test.
* c-c++-common/hwasan/alloca-base-init.c: New test.
* c-c++-common/hwasan/alloca-gets-different-tag.c: New test.
* c-c++-common/hwasan/alloca-outside-caught.c: New test.
* c-c++-common/hwasan/arguments-1.c: New test.
* c-c++-common/hwasan/arguments-2.c: New test.
* c-c++-common/hwasan/arguments-3.c: New test.
* c-c++-common/hwasan/arguments.c: New test.
* c-c++-common/hwasan/asan-pr63316.c: New test.
* c-c++-common/hwasan/asan-pr70541.c: New test.
* c-c++-common/hwasan/asan-pr78106.c: New test.
* c-c++-common/hwasan/asan-pr79944.c: New test.
* c-c++-common/hwasan/asan-rlimit-mmap-test-1.c: New test.
* c-c++-common/hwasan/bitfield-1.c: New test.
* c-c++-common/hwasan/bitfield-2.c: New test.
* c-c++-common/hwasan/builtin-special-handling.c: New test.
* c-c++-common/hwasan/check-interface.c: New test.
* c-c++-common/hwasan/halt_on_error-1.c: New test.
* c-c++-common/hwasan/handles-poly_int-marked-vars.c: New test.
* c-c++-common/hwasan/heap-overflow.c: New test.
* c-c++-common/hwasan/hwasan-poison-optimisation.c: New test.
* c-c++-common/hwasan/hwasan-thread-access-parent.c: New test.
* c-c++-common/hwasan/hwasan-thread-basic-failure.c: New test.
* c-c++-common/hwasan/hwasan-thread-clears-stack.c: New test.
* c-c++-common/hwasan/hwasan-thread-success.c: New test.
* c-c++-common/hwasan/kernel-defaults.c: New test.
* c-c++-common/hwasan/large-aligned-0.c: New test.
* c-c++-common/hwasan/large-aligned-1.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-0.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-1.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-2.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-3.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-4.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-5.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-6.c: New test.
* c-c++-common/hwasan/large-aligned-untagging-7.c: New test.
* c-c++-common/hwasan/macro-definition.c: New test.
* c-c++-common/hwasan/no-sanitize-attribute.c: New test.
* c-c++-common/hwasan/param-instrument-mem-intrinsics.c: New test.
* c-c++-common/hwasan/param-instrument-reads-and-writes.c: New test.
* c-c++-common/hwasan/param-instrument-reads.c: New test.
* c-c++-common/hwasan/param-instrument-writes.c: New test.
* c-c++-common/hwasan/random-frame-tag.c: New test.
* c-c++-common/hwasan/sanity-check-pure-c.c: New test.
* c-c++-common/hwasan/setjmp-longjmp-0.c: New test.
* c-c++-common/hwasan/setjmp-longjmp-1.c: New test.
* c-c++-common/hwasan/stack-tagging-basic-0.c: New test.
* c-c++-common/hwasan/stack-tagging-basic-1.c: New test.
* c-c++-common/hwasan/stack-tagging-disable.c: New test.
* c-c++-common/hwasan/unprotected-allocas-0.c: New test.
* c-c++-common/hwasan/unprotected-allocas-1.c: New test.
* c-c++-common/hwasan/use-after-free.c: New test.
* c-c++-common/hwasan/vararray-outside-caught.c: New test.
* c-c++-common/hwasan/vararray-stack-restore-correct.c: New test.
* c-c++-common/hwasan/very-large-objects.c: New test.
* g++.dg/hwasan/hwasan.exp: New test.
* g++.dg/hwasan/rvo-handled.C: New test.
* gcc.dg/hwasan/hwasan.exp: New test.
* gcc.dg/hwasan/nested-functions-0.c: New test.
* gcc.dg/hwasan/nested-functions-1.c: New test.
* gcc.dg/hwasan/nested-functions-2.c: New test.
* lib/hwasan-dg.exp: New file.
65 files changed:
gcc/testsuite/c-c++-common/hwasan/aligned-alloc.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/alloca-array-accessible.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/alloca-base-init.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/alloca-gets-different-tag.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/alloca-outside-caught.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/arguments-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/arguments-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/arguments-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/arguments.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/asan-pr63316.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/asan-pr70541.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/asan-pr78106.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/asan-pr79944.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/asan-rlimit-mmap-test-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/bitfield-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/bitfield-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/builtin-special-handling.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/check-interface.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/halt_on_error-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/handles-poly_int-marked-vars.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/heap-overflow.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/hwasan-poison-optimisation.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/hwasan-thread-access-parent.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/hwasan-thread-basic-failure.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/hwasan-thread-clears-stack.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/hwasan-thread-success.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/kernel-defaults.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-0.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-0.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-2.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-4.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-5.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-6.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/large-aligned-untagging-7.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/macro-definition.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/no-sanitize-attribute.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/param-instrument-mem-intrinsics.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/param-instrument-reads-and-writes.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/param-instrument-reads.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/param-instrument-writes.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/random-frame-tag.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/sanity-check-pure-c.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/setjmp-longjmp-0.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/setjmp-longjmp-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/stack-tagging-basic-0.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/stack-tagging-basic-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/stack-tagging-disable.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/unprotected-allocas-0.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/unprotected-allocas-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/use-after-free.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/vararray-outside-caught.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/vararray-stack-restore-correct.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/hwasan/very-large-objects.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c
gcc/testsuite/g++.dg/hwasan/hwasan.exp [new file with mode: 0644]
gcc/testsuite/g++.dg/hwasan/rvo-handled.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/hwasan/hwasan.exp [new file with mode: 0644]
gcc/testsuite/gcc.dg/hwasan/nested-functions-0.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/hwasan/nested-functions-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/hwasan/nested-functions-2.c [new file with mode: 0644]
gcc/testsuite/lib/asan-dg.exp
gcc/testsuite/lib/hwasan-dg.exp [new file with mode: 0644]