brintos

brintos / llvm-project-archived public Read only

0
0
Text · 647 B · f42802a Raw
22 lines · cpp
1// Check that sanitizer prints the faulting instruction bytes on2// dump_instruction_bytes=13 4// RUN: %clangxx  %s -o %t5// RUN: %env_tool_opts=dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP6// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP7 8// REQUIRES: x86-target-arch9 10int main() {11#if defined(__x86_64__)12  asm("movq $0, %rax");13  asm("movl $0xcafebabe, 0x0(%rax)");14#elif defined(i386)15  asm("movl $0, %eax");16  asm("movl $0xcafebabe, 0x0(%eax)");17#endif18  // CHECK-DUMP: First 16 instruction bytes at pc: c7 00 be ba fe ca19  // CHECK-NODUMP-NOT: First 16 instruction bytes20  return 0;21}22