[compiler-rt] r336714 - Limit ASan non-executable-pc test case to x86 bots

Vlad Tsyrklevich via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 10 12:34:46 PDT 2018


Author: vlad.tsyrklevich
Date: Tue Jul 10 12:34:46 2018
New Revision: 336714

URL: http://llvm.org/viewvc/llvm-project?rev=336714&view=rev
Log:
Limit ASan non-executable-pc test case to x86 bots

The test case fails on the big-endian PPC bot, probably because PowerPC
uses function descriptors. More over other architectures don't support
NX mappings. (This test case was not being exercised prior to r336633.)

Modified:
    compiler-rt/trunk/test/asan/TestCases/non-executable-pc.cpp

Modified: compiler-rt/trunk/test/asan/TestCases/non-executable-pc.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/non-executable-pc.cpp?rev=336714&r1=336713&r2=336714&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/non-executable-pc.cpp (original)
+++ compiler-rt/trunk/test/asan/TestCases/non-executable-pc.cpp Tue Jul 10 12:34:46 2018
@@ -3,10 +3,10 @@
 // RUN: not %run %t n 2>&1 | FileCheck %s -check-prefix=CHECK -check-prefix=NON_EXEC
 
 // Not every OS lists every memory region in MemoryMappingLayout.
-// REQUIRES: linux || freebsd || netbsd
-
-// We don't have non-execute protection on s390 processors before z14.
-// UNSUPPORTED: s390
+// This is limited to x86_64 because some architectures (e.g. the s390 before
+// the z14) don't support NX mappings and others like PowerPC use function
+// descriptors.
+// REQUIRES: x86-target-arch && (linux || freebsd || netbsd)
 
 #include <assert.h>
 
@@ -23,12 +23,6 @@ int main(int argc, char **argv) {
   }
 
   func();
-  // x86 reports the SEGV with both address=X and pc=X.
-  // On PowerPC64 ELFv1, the pointer is taken to be a function-descriptor
-  // pointer out of which three 64-bit quantities are read. This will SEGV, but
-  // the compiler is free to choose the order. As a result, the address is
-  // either X, X+0x8 or X+0x10. The pc is still in main() because it has not
-  // actually made the call when the faulting access occurs.
   // CHECK: DEADLYSIGNAL
   // CHECK: {{AddressSanitizer: (SEGV|access-violation).*(address|pc) }}
   // NON_EXEC: PC is at a non-executable region. Maybe a wild jump?




More information about the llvm-commits mailing list