Files
clang-p2996/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc
Jay Foad 9b70a919db [ASan] Skip dump_instruction_bytes test on non-x86 targets
Summary: This test case is blatantly x86-specific, so skip it on other targets.

Reviewers: kcc, eugenis, earthdok, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 221778
2014-11-12 09:45:40 +00:00

21 lines
680 B
C++

// Check that ASan prints the faulting instruction bytes on
// dump_instruction_bytes=1
// RUN: %clangxx_asan %s -o %t
// RUN: env ASAN_OPTIONS=dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP
// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP
//
// REQUIRES: x86_64-supported-target,i386-supported-target
int main() {
#if defined(__x86_64__)
asm("movq $0, %rax");
asm("movl $0xcafebabe, 0x0(%rax)");
#elif defined(i386)
asm("movl $0, %eax");
asm("movl $0xcafebabe, 0x0(%eax)");
#endif
// CHECK-DUMP: First 16 instruction bytes at pc: c7 00 be ba fe ca
// CHECK-NODUMP-NOT: First 16 instruction bytes
return 0;
}