llvm-project/llvm/test/Instrumentation/AddressSanitizer/X86
Anna Zaks 4f652b69b1 [asan] Don't run stack malloc on functions containing inline assembly.
It makes LLVM run out of registers even on 64-bit platforms. For example, the
following test case fails on darwin.

clang -cc1 -O0 -triple x86_64-apple-macosx10.10.0 -emit-obj -fsanitize=address -mstackrealign -o ~/tmp/ex.o -x c ex.c
error: inline assembly requires more registers than available

void TestInlineAssembly(const unsigned char *S, unsigned int pS, unsigned char *D, unsigned int pD, unsigned int h) {

unsigned int sr = 4, pDiffD = pD - 5;
unsigned int pDiffS = (pS << 1) - 5;
char flagSA = ((pS & 15) == 0),
flagDA = ((pD & 15) == 0);
asm volatile (
  "mov %0,  %%"PTR_REG("si")"\n"
  "mov %2,  %%"PTR_REG("cx")"\n"
  "mov %1,  %%"PTR_REG("di")"\n"
  "mov %8,  %%"PTR_REG("ax")"\n"
  :
  : "m" (S), "m" (D), "m" (pS), "m" (pDiffS), "m" (pDiffD), "m" (sr), "m" (flagSA), "m" (flagDA), "m" (h)
  : "%"PTR_REG("si"), "%"PTR_REG("di"), "%"PTR_REG("ax"), "%"PTR_REG("cx"), "%"PTR_REG("dx"), "memory"
);
}

http://reviews.llvm.org/D10719

llvm-svn: 240722
2015-06-25 23:35:45 +00:00
..
asm_attr.ll Fix the check strings in a test case committed in r212455. 2015-05-15 00:12:26 +00:00
asm_cfi.ll
asm_cfi.s [asan-asm-instrumentation] Fixed memory accesses with rbp as a base or an index register. 2014-10-21 10:22:27 +00:00
asm_cpuid.ll [ASan] Don't use stack malloc for 32-bit functions using inline asm 2015-04-02 21:44:55 +00:00
asm_more_registers_than_available.ll [asan] Don't run stack malloc on functions containing inline assembly. 2015-06-25 23:35:45 +00:00
asm_mov.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
asm_mov.s
asm_mov_no_instrumentation.s
asm_rep_movs.ll
asm_rsp_mem_op.s
asm_swap_intel.s
bug_11395.ll [opaque pointer type] Add textual IR support for explicit type parameter to load instruction 2015-02-27 21:17:42 +00:00
lit.local.cfg