[compiler-rt] 8144a7d - [compiler-rt][ubsan][test] Fix TypeCheck/misaligned.cpp on Sparc
Rainer Orth via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 11 03:47:11 PDT 2020
Author: Rainer Orth
Date: 2020-08-11T12:46:34+02:00
New Revision: 8144a7d8fc00c1ed779cb2dfabd826eedb19f296
URL: https://github.com/llvm/llvm-project/commit/8144a7d8fc00c1ed779cb2dfabd826eedb19f296
DIFF: https://github.com/llvm/llvm-project/commit/8144a7d8fc00c1ed779cb2dfabd826eedb19f296.diff
LOG: [compiler-rt][ubsan][test] Fix TypeCheck/misaligned.cpp on Sparc
Two ubsan tests FAIL on Sparc:
UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp
UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp
I've reported the details in Bug 47015, but it boils down to the fact that
the `s1` subtest actually incurs a fault on strict-alignment targets like
Sparc which UBSan doesn't expect.
This can be fixed like the `w1` subtest by compiling with
`-fno-sanitize-recover=alignment`.
Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and
`x86_64-pc-linux-gnu`.
Differential Revision: https://reviews.llvm.org/D85433
Added:
Modified:
compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
index a5cefaa31cd6..eff3ce6c27e9 100644
--- a/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
+++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/misaligned.cpp
@@ -1,7 +1,6 @@
// RUN: %clangxx %gmlt -fsanitize=alignment %s -O3 -o %t
// RUN: %run %t l0 && %run %t s0 && %run %t r0 && %run %t m0 && %run %t f0 && %run %t n0 && %run %t u0
// RUN: %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --strict-whitespace
-// RUN: %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE
// RUN: %run %t r1 2>&1 | FileCheck %s --check-prefix=CHECK-REFERENCE
// RUN: %run %t m1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMBER
// RUN: %run %t f1 2>&1 | FileCheck %s --check-prefix=CHECK-MEMFUN
@@ -10,6 +9,7 @@
// RUN: %env_ubsan_opts=print_stacktrace=1 %run %t l1 2>&1 | FileCheck %s --check-prefix=CHECK-LOAD --check-prefix=CHECK-STACK-LOAD
// RUN: %clangxx -fsanitize=alignment -fno-sanitize-recover=alignment %s -O3 -o %t
+// RUN: not %run %t s1 2>&1 | FileCheck %s --check-prefix=CHECK-STORE
// RUN: not %run %t w1 2>&1 | FileCheck %s --check-prefix=CHECK-WILD
// Compilation error make the test fails.
// XFAIL: openbsd
More information about the llvm-commits
mailing list