File: dwarf5-call-site-entry-reloc.test

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.8-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,388 kB
  • sloc: cpp: 7,438,767; ansic: 1,393,871; asm: 1,012,926; python: 241,728; f90: 86,635; objc: 75,411; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (40 lines) | stat: -rw-r--r-- 1,387 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## Test binaries created with the following commands:

## $ cat call-dwarf5.c
## __attribute__((noinline, noreturn)) void foo() {
##     asm volatile("" ::: "memory");
##       __builtin_unreachable();
## }
## __attribute__((noinline)) void bar() {
##     asm volatile("nop" :::);
##      foo();
## }

## int main() { bar(); }

## $ clang -gdwarf-5 call-dwarf5.c -fomit-frame-pointer -c -Os -o call-dwarf5.o
## $ clang -gdwarf-5 call-dwarf5.o -o call-dwarf5

## The test requires the return PC to match a relocation (in this case the
## DW_AT_high_pc of main). Without this change the value would get relocated
## twice.

#RUN: dsymutil -oso-prepend-path %p/../Inputs -y %s -o %t.dSYM
#RUN: llvm-dwarfdump %t.dSYM | FileCheck %s -implicit-check-not=DW_AT_call_return_pc

#RUN: dsymutil --linker parallel -oso-prepend-path %p/../Inputs -y %s -o %t.dSYM
#RUN: llvm-dwarfdump %t.dSYM | FileCheck %s -implicit-check-not=DW_AT_call_return_pc

#CHECK: DW_AT_call_return_pc  (0x0000000100000f72)
#CHECK: DW_AT_call_return_pc  (0x0000000100000f78)

---
triple:          'x86_64-apple-darwin'
objects:
  - filename:        'call-dwarf5.o'
    timestamp:       1675373912
    symbols:
      - { sym: _foo, objAddr: 0x0, binAddr: 0x100000F69, size: 0x2 }
      - { sym: _bar, objAddr: 0x2, binAddr: 0x100000F6B, size: 0x7 }
      - { sym: _main, objAddr: 0x9, binAddr: 0x100000F72, size: 0x6 }
...