[compiler-rt] r221542 - [ASan] Fix zero_page_pc test for PowerPC

Jay Foad jay.foad at gmail.com
Fri Nov 7 12:42:11 PST 2014


Author: foad
Date: Fri Nov  7 14:42:11 2014
New Revision: 221542

URL: http://llvm.org/viewvc/llvm-project?rev=221542&view=rev
Log:
[ASan] Fix zero_page_pc test for PowerPC

Summary:
In the Power architecture, all branch instructions ignore the 2 least
significant bits of the target address. Consequently if you branch to an
invalid address, the address reported along with the SIGSEGV will have
been rounded down to a multiple of 4. Tweak this test accordingly.

This may fix the test for ARM too, in which case we could remove
the XFAIL, but I have no way of testing that.

Reviewers: kcc, willschm, glider, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6167

Modified:
    compiler-rt/trunk/test/asan/TestCases/zero_page_pc.cc

Modified: compiler-rt/trunk/test/asan/TestCases/zero_page_pc.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/zero_page_pc.cc?rev=221542&r1=221541&r2=221542&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/zero_page_pc.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/zero_page_pc.cc Fri Nov  7 14:42:11 2014
@@ -7,8 +7,8 @@
 
 typedef void void_f();
 int main() {
-  void_f *func = (void_f *)0x7;
+  void_f *func = (void_f *)0x4;
   func();
-  // CHECK: {{AddressSanitizer: SEGV.*(pc.*0007)}}
+  // CHECK: {{AddressSanitizer: SEGV.*(pc.*0004)}}
   return 0;
 }





More information about the llvm-commits mailing list