Fix gc-test.cc to work under higher -O levels
authorKuba Brecka <kuba.brecka@gmail.com>
Sun, 22 Feb 2015 11:12:17 +0000 (11:12 +0000)
committerKuba Brecka <kuba.brecka@gmail.com>
Sun, 22 Feb 2015 11:12:17 +0000 (11:12 +0000)
commit11bb33c78b75cbff5eca1eacb8790bd018502ceb
treee8af2ea80306f17f0ea700a7fe0f3c369cc759c0
parentbc4c42c3458edf7b75c47d3b6303462a1a5b0e4a
Fix gc-test.cc to work under higher -O levels

The gc-test.cc tries underflows of a variable up to -32 bytes, but on i386, the left redzone is not 32 bytes, it’s only 16 bytes and therefore the access to var[-32] is completely off. The reason why this test didn’t fail before is that we’ve been lucky and there was another variable before the var array, which was also instrumented. This fix uses “-32” for 64-bit systems and “-16” for 32-bit.

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

llvm-svn: 230172
compiler-rt/test/asan/TestCases/gc-test.cc