[compiler-rt] c8f4e06 - [sanitizer] Fix test on arm 32bit

via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 14 00:02:33 PST 2020


Author: Vitaly Buka
Date: 2020-11-14T00:02:29-08:00
New Revision: c8f4e06b29f4a91dc97f711901ebd575f840613a

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

LOG: [sanitizer] Fix test on arm 32bit

Make test values suitable for PC alignment arithmetic used
in StackTrace::Print().

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
index aa0fd60ec1e3..28eb3f49d751 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
@@ -72,17 +72,17 @@ TEST(SanitizerCommon, StackDepotSeveral) {
 #define Maybe_StackDepotPrint StackDepotPrint
 #endif
 TEST(SanitizerCommon, Maybe_StackDepotPrint) {
-  uptr array1[] = {1, 2, 3, 4, 7};
+  uptr array1[] = {0x111, 0x222, 0x333, 0x444, 0x777};
   StackTrace s1(array1, ARRAY_SIZE(array1));
   u32 i1 = StackDepotPut(s1);
-  uptr array2[] = {1, 2, 3, 4, 8, 9};
+  uptr array2[] = {0x1111, 0x2222, 0x3333, 0x4444, 0x8888, 0x9999};
   StackTrace s2(array2, ARRAY_SIZE(array2));
   u32 i2 = StackDepotPut(s2);
   EXPECT_NE(i1, i2);
   EXPECT_EXIT(
       (StackDepotPrintAll(), exit(0)), ::testing::ExitedWithCode(0),
-      "Stack for id .*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x6.*Stack for id "
-      ".*#0 0x0.*#1 0x1.*#2 0x2.*#3 0x3.*#4 0x7.*#5 0x8.*");
+      "Stack for id .*#0 0x1.*#1 0x2.*#2 0x3.*#3 0x4.*#4 0x7.*Stack for id "
+      ".*#0 0x1.*#1 0x2.*#2 0x3.*#3 0x4.*#4 0x8.*#5 0x9.*");
 }
 
 TEST(SanitizerCommon, StackDepotReverseMap) {


        


More information about the llvm-commits mailing list