1 ## This test makes sure we can extract the instrumentation map from an
2 ## XRay-instrumented PIE file.
4 # RUN: yaml2obj %S/Inputs/elf64-pic.yaml -o %t.so
5 # RUN: llvm-xray extract %t.so -s | FileCheck %s
6 # RUN: llvm-xray extract %t.so --no-demangle --demangle -s | FileCheck %s
9 # CHECK-NEXT: - { id: 1, address: 0x420, function: 0x420, kind: function-enter, always-instrument: true, function-name: 'foo()' }
10 # CHECK-NEXT: - { id: 1, address: 0x440, function: 0x420, kind: function-exit, always-instrument: true, function-name: 'foo()' }
11 # CHECK-NEXT: - { id: 2, address: 0x464, function: 0x464, kind: function-enter, always-instrument: true, function-name: 'bar()' }
12 # CHECK-NEXT: - { id: 2, address: 0x484, function: 0x464, kind: function-exit, always-instrument: true, function-name: 'bar()' }
13 # CHECK-NEXT: - { id: 3, address: 0x4A8, function: 0x4A8, kind: function-enter, always-instrument: true, function-name: 'jar()' }
14 # CHECK-NEXT: - { id: 3, address: 0x4C8, function: 0x4A8, kind: function-exit, always-instrument: true, function-name: 'jar()' }
17 # RUN: llvm-xray extract -s --no-demangle %t.so | FileCheck --check-prefix=MANGLED %s
18 # RUN: llvm-xray extract -s --demangle --no-demangle %t.so | FileCheck --check-prefix=MANGLED %s
21 # MANGLED-NEXT: - { id: 1, address: 0x420, function: 0x420, kind: function-enter, always-instrument: true, function-name: _Z3foov }
22 # MANGLED-NEXT: - { id: 1, address: 0x440, function: 0x420, kind: function-exit, always-instrument: true, function-name: _Z3foov }
23 # MANGLED-NEXT: - { id: 2, address: 0x464, function: 0x464, kind: function-enter, always-instrument: true, function-name: _Z3barv }
24 # MANGLED-NEXT: - { id: 2, address: 0x484, function: 0x464, kind: function-exit, always-instrument: true, function-name: _Z3barv }
25 # MANGLED-NEXT: - { id: 3, address: 0x4A8, function: 0x4A8, kind: function-enter, always-instrument: true, function-name: _Z3jarv }
26 # MANGLED-NEXT: - { id: 3, address: 0x4C8, function: 0x4A8, kind: function-exit, always-instrument: true, function-name: _Z3jarv }