xref: /llvm-project/llvm/test/tools/llvm-exegesis/X86/latency/subprocess-address-annotation.s (revision f1963fde9f8be49454d827d72b83ee8aaa78a9cc)
1# REQUIRES: exegesis-can-measure-latency, x86_64-linux
2
3# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=%s -execution-mode=subprocess | FileCheck %s
4
5# Check that the code is loaded in at the expected address.
6
7# LLVM-EXEGESIS-SNIPPET-ADDRESS 20000
8# LLVM-EXEGESIS-DEFREG RAX 0
9# LLVM-EXEGESIS-DEFREG R14 127
10# LLVM-EXEGESIS-DEFREG R15 0
11# LLVM-EXEGESIS-DEFREG RDI 0
12
13# Load the instruction pointer and round down to the nearest page as there
14# will be some setup code loaded in before this part begins to execute.
15lea 0(%rip), %rax
16shrq $12, %rax
17shlq $12, %rax
18
19cmpq $0x20000, %rax
20cmovneq %r14, %r15
21
22movq $60, %rax
23movq %r15, %rdi
24syscall
25
26# CHECK-NOT: error:           'Child benchmarking process exited with non-zero exit code: Child process returned with unknown exit code'
27