[compiler-rt] 91bc4ab - [sanitizer][test] Fix FastUnwindTest on LoongArch

Weining Lu via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 9 21:36:26 PST 2022


Author: Youling Tang
Date: 2022-11-10T13:35:52+08:00
New Revision: 91bc4abfdba65a0ef7e40915bdff62324bccf2f2

URL: https://github.com/llvm/llvm-project/commit/91bc4abfdba65a0ef7e40915bdff62324bccf2f2
DIFF: https://github.com/llvm/llvm-project/commit/91bc4abfdba65a0ef7e40915bdff62324bccf2f2.diff

LOG: [sanitizer][test] Fix FastUnwindTest on LoongArch

Fixes the `FastUnwindTest` unit test for LoongArch.
This change is similar to RISCV D90574.

The following test cases pass after applying the patch:
```
$ ./runtimes/runtimes-bins/compiler-rt/lib/sanitizer_common/tests/Sanitizer-loongarch64-Test
...
[  FAILED  ] FastUnwindTest.Basic
[  FAILED  ] FastUnwindTest.FramePointerLoop
[  FAILED  ] FastUnwindTest.MisalignedFramePointer
[  FAILED  ] FastUnwindTest.FPBelowPrevFP
[  FAILED  ] FastUnwindTest.CloseToZeroFrame
```

Reviewed By: SixWeining, xen0n, MaskRay

Differential Revision: https://reviews.llvm.org/D137314

Added: 
    

Modified: 
    compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
index e8d590a503a9a..a9dd0669ccb96 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp
@@ -44,7 +44,7 @@ class FastUnwindTest : public ::testing::Test {
   uhwptr fake_bottom;
   BufferedStackTrace trace;
 
-#if defined(__riscv)
+#if defined(__loongarch__) || defined(__riscv)
   const uptr kFpOffset = 4;
   const uptr kBpOffset = 2;
 #else


        


More information about the llvm-commits mailing list