xref: /llvm-project/bolt/test/non-empty-debug-line.test (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1*11791ae7SSayhaan Siddiqui## Verifies that BOLT emits DWARF line table with the same size if
2*11791ae7SSayhaan Siddiqui## no functions with debug info were modified.
3b73c87bcSMaksim Panchenko
4b392ec69SRafael AulerREQUIRES: system-linux
5b392ec69SRafael Auler
6dcc595eaSVladislav KhmelevskyRUN: %clang %cflags %S/Inputs/hello.c -g -o %t
7d648aa1bSMaksim PanchenkoRUN: llvm-bolt %t -o %t1 --update-debug-sections --funcs=_start
8b73c87bcSMaksim PanchenkoRUN: llvm-readobj -S %t > %t2
9b73c87bcSMaksim PanchenkoRUN: llvm-readobj -S %t1 >> %t2
10b73c87bcSMaksim PanchenkoRUN: FileCheck %s --input-file %t2
11b73c87bcSMaksim Panchenko
12*11791ae7SSayhaan Siddiqui## Check the input and grab .debug_line size.
13b73c87bcSMaksim PanchenkoCHECK: File:
14b73c87bcSMaksim PanchenkoCHECK: Name: .debug_line
15b73c87bcSMaksim PanchenkoCHECK: Size: [[SIZE:[0-9]+]]
16b73c87bcSMaksim Panchenko
17*11791ae7SSayhaan Siddiqui## Verify .debug_line size is the same after BOLT.
18b73c87bcSMaksim PanchenkoCHECK: File:
19b73c87bcSMaksim PanchenkoCHECK: Name: .debug_line
20b73c87bcSMaksim PanchenkoCHECK: Size:
21b73c87bcSMaksim PanchenkoCHECK-SAME: [[SIZE]]
22