[compiler-rt] 7006738 - [sanitizer] Fix StackDepotPrint testing

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 03:07:40 PST 2020


Author: Vitaly Buka
Date: 2020-11-16T03:07:29-08:00
New Revision: 7006738131cb397d2f1cda2280d8f0feb2ac6e1e

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

LOG: [sanitizer] Fix StackDepotPrint testing

Make test order agnostic as it can change with platform.

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 28eb3f49d751..998bda60055d 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cpp
@@ -79,10 +79,11 @@ TEST(SanitizerCommon, Maybe_StackDepotPrint) {
   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 0x1.*#1 0x2.*#2 0x3.*#3 0x4.*#4 0x7.*");
   EXPECT_EXIT(
       (StackDepotPrintAll(), exit(0)), ::testing::ExitedWithCode(0),
-      "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.*");
+      "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