Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Posix / dump_instruction_bytes.cpp
blobf42802a34582b9dd8df1e34d25096a1a4dec4342
1 // Check that sanitizer prints the faulting instruction bytes on
2 // dump_instruction_bytes=1
4 // RUN: %clangxx %s -o %t
5 // RUN: %env_tool_opts=dump_instruction_bytes=1 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-DUMP
6 // RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-NODUMP
8 // REQUIRES: x86-target-arch
10 int 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 #endif
18 // CHECK-DUMP: First 16 instruction bytes at pc: c7 00 be ba fe ca
19 // CHECK-NODUMP-NOT: First 16 instruction bytes
20 return 0;