[compiler-rt] r232920 - Fix a flaky heap-overflow-large.cc test

Kuba Brecka kuba.brecka at gmail.com
Sun Mar 22 11:00:58 PDT 2015


Author: kuba.brecka
Date: Sun Mar 22 13:00:58 2015
New Revision: 232920

URL: http://llvm.org/viewvc/llvm-project?rev=232920&view=rev
Log:
Fix a flaky heap-overflow-large.cc test

Reviewed at http://reviews.llvm.org/D8515


Modified:
    compiler-rt/trunk/test/asan/TestCases/heap-overflow-large.cc

Modified: compiler-rt/trunk/test/asan/TestCases/heap-overflow-large.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/heap-overflow-large.cc?rev=232920&r1=232919&r2=232920&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/heap-overflow-large.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/heap-overflow-large.cc Sun Mar 22 13:00:58 2015
@@ -15,9 +15,9 @@ int main(int argc, char *argv[]) {
   int *x = new int[5];
   memset(x, 0, sizeof(x[0]) * 5);
   int index = atoi(argv[1]);
-  int res = x[index];
+  unsigned res = x[index];
   // CHECK: main
   // CHECK-NOT: CHECK failed
   delete[] x;
-  return res ? res : 1;
+  return (res % 10) + 1;
 }





More information about the llvm-commits mailing list