diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2019-02-15 23:16:25 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2019-02-15 23:16:25 +0000 |
commit | 9695618899f4f85d1e9fdbe7728d0e238b99511c (patch) | |
tree | 56c90d27c68460aff02f05398ef4fd4edc8f55c0 /gcc | |
parent | 34c5627c9cfea3eecbfbe3a1edeaaa703ddee553 (diff) | |
download | gcc-9695618899f4f85d1e9fdbe7728d0e238b99511c.zip gcc-9695618899f4f85d1e9fdbe7728d0e238b99511c.tar.gz gcc-9695618899f4f85d1e9fdbe7728d0e238b99511c.tar.bz2 |
asan_oob_test.cc: Skip OOB_int on SPARC.
* g++.dg/asan/asan_oob_test.cc: Skip OOB_int on SPARC.
* g++.dg/asan/function-argument-3.C: Tweak for 32-bit SPARC.
From-SVN: r268951
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/asan/asan_oob_test.cc | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/asan/function-argument-3.C | 15 |
3 files changed, 23 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e279a8e..7fa8da5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-02-15 Eric Botcazou <ebotcazou@adacore.com> + + * g++.dg/asan/asan_oob_test.cc: Skip OOB_int on SPARC. + * g++.dg/asan/function-argument-3.C: Tweak for 32-bit SPARC. + 2019-02-15 Tamar Christina <tamar.christina@arm.com> * lib/target-supports.exp diff --git a/gcc/testsuite/g++.dg/asan/asan_oob_test.cc b/gcc/testsuite/g++.dg/asan/asan_oob_test.cc index 2361dc2..7d3f557 100644 --- a/gcc/testsuite/g++.dg/asan/asan_oob_test.cc +++ b/gcc/testsuite/g++.dg/asan/asan_oob_test.cc @@ -68,9 +68,13 @@ TEST(AddressSanitizer, OOB_char) { OOBTest<U1>(); } +// The following test uses unaligned memory accesses + +#if !defined(__sparc__) TEST(AddressSanitizer, OOB_int) { OOBTest<U4>(); } +#endif TEST(AddressSanitizer, OOBRightTest) { for (size_t access_size = 1; access_size <= 8; access_size *= 2) { diff --git a/gcc/testsuite/g++.dg/asan/function-argument-3.C b/gcc/testsuite/g++.dg/asan/function-argument-3.C index 26b3f92..bfe9b78 100644 --- a/gcc/testsuite/g++.dg/asan/function-argument-3.C +++ b/gcc/testsuite/g++.dg/asan/function-argument-3.C @@ -2,7 +2,16 @@ // { dg-shouldfail "asan" } // { dg-additional-options "-Wno-psabi" } +// On SPARC 32-bit, only vectors up to 8 bytes are passed in registers +#if defined(__sparc__) && !defined(__sparcv9) && !defined(__arch64__) +#define SMALL_VECTOR +#endif + +#ifdef SMALL_VECTOR +typedef int v4si __attribute__ ((vector_size (8))); +#else typedef int v4si __attribute__ ((vector_size (16))); +#endif static __attribute__ ((noinline)) int goo (v4si *a) @@ -19,10 +28,14 @@ foo (v4si arg) int main () { +#ifdef SMALL_VECTOR + v4si v = {1,2}; +#else v4si v = {1,2,3,4}; +#endif return foo (v); } // { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" } // { dg-output "READ of size . at.*" } -// { dg-output ".*'arg' \\(line 14\\) <== Memory access at offset \[0-9\]* overflows this variable.*" } +// { dg-output ".*'arg' \\(line 23\\) <== Memory access at offset \[0-9\]* overflows this variable.*" } |