[sanitizer] Fix test on arm 32bit
authorVitaly Buka <vitalybuka@google.com>
Sat, 14 Nov 2020 08:02:29 +0000 (00:02 -0800)
committerGitHub <noreply@github.com>
Sat, 14 Nov 2020 08:02:29 +0000 (00:02 -0800)
Make test values suitable for PC alignment arithmetic used
in StackTrace::Print().

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

index aa0fd60..28eb3f4 100644 (file)
@@ -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) {