| # REQUIRES: x86 | |
| ## Test dynamic debugging `-trace-symbol=<symbol>` | |
| # RUN: rm -rf %t && split-file %s %t && cd %t | |
| # RUN: llvm-mc -filetype=obj -triple=x86_64 foo.s -o foo.o | |
| # RUN: llvm-mc -filetype=obj -triple=x86_64 bar.s -o bar.o | |
| # RUN: llvm-mc -filetype=obj -triple=x86_64 bar-unopt.s -o bar-unopt.o | |
| ## Create dynamic debugging style object. | |
| # RUN: llvm-objcopy --add-section=.debug_llvm_dyndbg=bar-unopt.o bar.o | |
| # RUN: llvm-objcopy --set-section-type=.debug_llvm_dyndbg=0x6fff4c10 \ | |
| # RUN: --set-section-alignment=.debug_llvm_dyndbg=8 bar.o | |
| # RUN: ld.lld -trace-symbol=foo -shared foo.o bar.o | FileCheck %s | |
| # CHECK: foo.o: definition of foo | |
| # CHECK-NEXT: bar.o: reference to foo | |
| # CHECK-NEXT: bar.o: dynamic debugging reference to foo | |
| #--- foo.s | |
| .globl foo | |
| .type foo,@function | |
| foo: | |
| ret | |
| #--- bar.s | |
| .globl bar | |
| .type bar,@function | |
| bar: | |
| ret | |
| #--- bar-unopt.s | |
| .globl __dyndbg.baz | |
| .hidden __dyndbg.baz | |
| .type __dyndbg.baz,@function | |
| __dyndbg.baz: | |
| call foo | |
| ret |