Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / encoding-validation.s
blob0c716abc4cc0cf4a335bc6d7d218cdcd5d7568b4
1 # REQUIRES: system-linux
3 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-linux %s -o %t.o
4 # RUN: ld.lld %t.o -o %t.exe -q
5 # RUN: llvm-bolt %t.exe --relocs -o %t.out --check-encoding |& FileCheck %s
7 .text
8 .globl _start
9 .type _start, %function
10 _start:
11 .cfi_startproc
13 ## Check that llvm-bolt uses non-symbolizing disassembler while validating
14 ## instruction encodings. If symbol "foo" below is symbolized, the encoded
15 ## instruction would have a different sequence of bytes from the input
16 ## sequence, as "foo" will not have any address assigned at that point.
18 movq foo(%rip), %rax
19 # CHECK-NOT: mismatching LLVM encoding detected
21 ret
22 .cfi_endproc
23 .size _start, .-_start
25 .globl foo
26 .type foo, %function
27 foo:
28 .cfi_startproc
29 ret
30 .cfi_endproc
31 .size foo, .-foo