[compiler-rt] 3ab118a - [NFC][Asan] Fix test broken by RegAllocFast

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 16:50:06 PDT 2020


Author: Vitaly Buka
Date: 2020-09-18T16:46:20-07:00
New Revision: 3ab118a57d3803f45e3fe95321654994f2c9e1a1

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

LOG: [NFC][Asan] Fix test broken by RegAllocFast

The test worked only because by coincidence register with pointer was
clobbered.
After D52010 value is still preserved.

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Linux/leak.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/asan/TestCases/Linux/leak.cpp b/compiler-rt/test/asan/TestCases/Linux/leak.cpp
index e22cd6eac16f..a4ee99b1f408 100644
--- a/compiler-rt/test/asan/TestCases/Linux/leak.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/leak.cpp
@@ -9,8 +9,7 @@
 int *t;
 
 int main(int argc, char **argv) {
-  t = new int[argc - 1];
+  t = new int[argc - 1] - 100000;
   printf("t: %p\n", t);
-  t = 0;
 }
 // CHECK: LeakSanitizer: detected memory leaks


        


More information about the llvm-commits mailing list