xref: /llvm-project/bolt/test/X86/line-number.test (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1## Verifies that the extraction of DWARF line number information is correct.
2
3RUN: %clangxx %cxxflags %S/Inputs/linenumber.cpp -g -o %t
4RUN: llvm-bolt %t -o %t.null --print-reordered --update-debug-sections \
5RUN:   --print-debug-info --reorder-blocks=reverse --sequential-disassembly \
6RUN:   2>&1 | FileCheck %s
7
8## Local variable in f()
9CHECK: movl    $0xbeef, -0x4(%rbp) # debug line {{.*}}linenumber.cpp:9
10## Checks that a branch instruction that is inserted by BOLT does not have
11## debug line info associated with it.
12CHECK-NOT: jmp   .LFT0 # debug line {{.*}}linenumber.cpp:1
13## Call to f() in g()
14CHECK: callq   _Z1fv{{.*}} # debug line {{.*}}linenumber.cpp:19
15## Calls to g() and f() in main
16CHECK: callq   _Z1gv{{.*}} # debug line {{.*}}linenumber.cpp:23
17CHECK: callq   _Z1fv{{.*}} # debug line {{.*}}linenumber.cpp:23
18