xref: /llvm-project/bolt/test/X86/inline-debug-info.test (revision d648aa1b8e937de1648524e1f1016b53b29ba2a4)
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 -g %p/Inputs/inline-main.c %p/Inputs/inline-foo.c \
7# RUN:   -I%p/../Inputs -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 \
10# RUN:   -o %t.bolt \
11# RUN:   | FileCheck %s
12
13## The call to puts() should come from inline-foo.c:
14# CHECK: callq   {{.*}} # debug line {{.*}}inline-foo.c:4:3
15
16# RUN: llvm-objdump --disassemble-symbols=main -d --line-numbers %t.bolt \
17# RUN:   | FileCheck %s -check-prefix=CHECK-OBJDUMP
18
19## Dump of main() should include debug info from inline-foo.c after inlining:
20# CHECK-OBJDUMP: inline-foo.c:4
21