[compiler-rt] r347118 - [hwasan] make the heap-buffer-overflow.c test more robust and re-enable it. With malloc_align_right the relative offsets of heap chunks are less predictable to simply don't test for them.

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 16 16:40:34 PST 2018


Author: kcc
Date: Fri Nov 16 16:40:34 2018
New Revision: 347118

URL: http://llvm.org/viewvc/llvm-project?rev=347118&view=rev
Log:
[hwasan] make the heap-buffer-overflow.c test more robust and re-enable it. With malloc_align_right the relative offsets of heap chunks are less predictable to simply don't test for them.

Modified:
    compiler-rt/trunk/test/hwasan/TestCases/heap-buffer-overflow.c

Modified: compiler-rt/trunk/test/hwasan/TestCases/heap-buffer-overflow.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/hwasan/TestCases/heap-buffer-overflow.c?rev=347118&r1=347117&r2=347118&view=diff
==============================================================================
--- compiler-rt/trunk/test/hwasan/TestCases/heap-buffer-overflow.c (original)
+++ compiler-rt/trunk/test/hwasan/TestCases/heap-buffer-overflow.c Fri Nov 16 16:40:34 2018
@@ -2,7 +2,7 @@
 // RUN:                                       not %run %t 40 2>&1 | FileCheck %s --check-prefix=CHECK40-LEFT
 // RUN: %env_hwasan_opts=malloc_align_right=2 not %run %t 40 2>&1 | FileCheck %s --check-prefix=CHECK40-RIGHT
 // RUN:                                       not %run %t 80 2>&1 | FileCheck %s --check-prefix=CHECK80-LEFT
-// DISABLED: %env_hwasan_opts=malloc_align_right=2 not %run %t 80 2>&1 | FileCheck %s --check-prefix=CHECK80-RIGHT
+// RUN: %env_hwasan_opts=malloc_align_right=2 not %run %t 80 2>&1 | FileCheck %s --check-prefix=CHECK80-RIGHT
 // RUN: not %run %t -30 2>&1 | FileCheck %s --check-prefix=CHECKm30
 // RUN: not %run %t -30 1000000 2>&1 | FileCheck %s --check-prefix=CHECKMm30
 // RUN: not %run %t 1000000 1000000 2>&1 | FileCheck %s --check-prefix=CHECKM
@@ -35,12 +35,12 @@ int main(int argc, char **argv) {
 
 // CHECK40-LEFT: allocated heap chunk; size: 32 offset: 8
 // CHECK40-LEFT: is located 10 bytes to the right of 30-byte region
-// CHECK40-RIGHT: allocated heap chunk; size: 32 offset: 10
+// CHECK40-RIGHT: allocated heap chunk; size: 32 offset:
 // CHECK40-RIGHT: is located 10 bytes to the right of 30-byte region
 //
 // CHECK80-LEFT: allocated heap chunk; size: 32 offset: 16
 // CHECK80-LEFT: is located 50 bytes to the right of 30-byte region
-// CHECK80-RIGHT: allocated heap chunk; size: 32 offset: 18
+// CHECK80-RIGHT: allocated heap chunk; size: 32 offset:
 // CHECK80-RIGHT: is located 50 bytes to the right of 30-byte region
 //
 // CHECKm30: allocated heap chunk; size: 32 offset: 2




More information about the llvm-commits mailing list