[NFC][Asan] Fix test broken by RegAllocFast
authorVitaly Buka <vitalybuka@google.com>
Fri, 18 Sep 2020 23:46:20 +0000 (16:46 -0700)
committerVitaly Buka <vitalybuka@google.com>
Fri, 18 Sep 2020 23:46:20 +0000 (16:46 -0700)
The test worked only because by coincidence register with pointer was
clobbered.
After D52010 value is still preserved.

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

index e22cd6e..a4ee99b 100644 (file)
@@ -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