xref: /llvm-project/bolt/test/X86/inline-debug-info.test (revision 9407a701790fc8c55795f992ded9a40bd37ca7d1)
1## Check that BOLT correctly prints and updates debug info for inlined
2## functions.
3
4# REQUIRES: system-linux
5
6# RUN: %clang %cflags -O1 -gdwarf-4 %p/Inputs/inline-main.c %p/Inputs/inline-foo.c \
7# RUN:   -o %t.exe -Wl,-q
8# RUN: llvm-bolt %t.exe -update-debug-sections -print-debug-info \
9# RUN:   -print-only=main -print-after-lowering -force-inline=foo -o %t.bolt \
10# RUN:   | FileCheck %s
11
12## The call to puts() should come from inline-foo.c:
13# CHECK: callq   puts@PLT # debug line {{.*}}inline-foo.c:4:3
14
15# RUN: llvm-objdump --disassemble-symbols=main -d --line-numbers %t.bolt \
16# RUN:   | FileCheck %s -check-prefix=CHECK-OBJDUMP
17
18## Dump of main() should include debug info from inline-foo.c after inlining:
19# CHECK-OBJDUMP: inline-foo.c:4
20