xref: /llvm-project/bolt/test/X86/dwarf5-two-cu-str-offset-table.test (revision 6aad62cf5b7f91f4b02266cf72469e2c8e28dbef)
1fb9a8512SAlexander Yermolovich# REQUIRES: system-linux
2fb9a8512SAlexander Yermolovich
3fb9a8512SAlexander Yermolovich# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_main.s -o %tmain.o
4fb9a8512SAlexander Yermolovich# RUN: llvm-mc -dwarf-version=5 -filetype=obj -triple x86_64-unknown-linux %p/Inputs/dwarf5_helper.s -o %thelper.o
5fb9a8512SAlexander Yermolovich# RUN: %clang %cflags -dwarf-5 %tmain.o %thelper.o -o %t.exe -Wl,-q
6*6aad62cfSSayhaan Siddiqui# RUN: llvm-bolt %t.exe -o %t.bolt --update-debug-sections --debug-thread-count=4 --cu-processing-batch-size=4
7fb9a8512SAlexander Yermolovich# RUN: llvm-dwarfdump --show-form --verbose --debug-str-offsets %t.exe > %t.txt
8fb9a8512SAlexander Yermolovich# RUN: llvm-dwarfdump --show-form --verbose --debug-str-offsets %t.bolt >> %t.txt
9fb9a8512SAlexander Yermolovich# RUN: cat %t.txt | FileCheck --check-prefix=CHECK %s
10fb9a8512SAlexander Yermolovich
11fb9a8512SAlexander Yermolovich## This test checks we correclty re-renerate .debug_str_offsets.
12fb9a8512SAlexander Yermolovich
13fb9a8512SAlexander Yermolovich# CHECK: .debug_str_offsets contents
14fb9a8512SAlexander Yermolovich# CHECK-NEXT: 0x00000000: Contribution size = 52, Format = DWARF32, Version = 5
15fb9a8512SAlexander Yermolovich# CHECK-NEXT: "clang version 15.0.0"
16fb9a8512SAlexander Yermolovich# CHECK-NEXT: "main.cpp"
17fb9a8512SAlexander Yermolovich# CHECK-NEXT: "/testLocListMultiple"
18fb9a8512SAlexander Yermolovich# CHECK-NEXT: "_Z3usePiS_"
19fb9a8512SAlexander Yermolovich# CHECK-NEXT: "use"
20fb9a8512SAlexander Yermolovich# CHECK-NEXT: "main"
21fb9a8512SAlexander Yermolovich# CHECK-NEXT: "int"
22fb9a8512SAlexander Yermolovich# CHECK-NEXT: "x"
23fb9a8512SAlexander Yermolovich# CHECK-NEXT: "y"
24fb9a8512SAlexander Yermolovich# CHECK-NEXT: "argc"
25fb9a8512SAlexander Yermolovich# CHECK-NEXT: "argv"
26fb9a8512SAlexander Yermolovich# CHECK-NEXT: "char"
27fb9a8512SAlexander Yermolovich# CHECK-NEXT: 0x00000038: Contribution size = 48, Format = DWARF32, Version = 5
28fb9a8512SAlexander Yermolovich# CHECK-NEXT: "clang version 15.0.0)"
29fb9a8512SAlexander Yermolovich# CHECK-NEXT: "foo.cpp"
30fb9a8512SAlexander Yermolovich# CHECK-NEXT: "/testLocListMultiple"
31fb9a8512SAlexander Yermolovich# CHECK-NEXT: "fooVar"
32fb9a8512SAlexander Yermolovich# CHECK-NEXT: "int"
33fb9a8512SAlexander Yermolovich# CHECK-NEXT: "_Z6useFooPi"
34fb9a8512SAlexander Yermolovich# CHECK-NEXT: "useFoo"
35fb9a8512SAlexander Yermolovich# CHECK-NEXT: "x"
36fb9a8512SAlexander Yermolovich# CHECK-NEXT: "_Z3fooi"
37fb9a8512SAlexander Yermolovich# CHECK-NEXT: "foo"
38fb9a8512SAlexander Yermolovich# CHECK-NEXT: "argc"
39fb9a8512SAlexander Yermolovich
40fb9a8512SAlexander Yermolovich## Checking post bolt
41fb9a8512SAlexander Yermolovich# CHECK: .debug_str_offsets contents
42fb9a8512SAlexander Yermolovich# CHECK-NEXT: 0x00000000: Contribution size = 52, Format = DWARF32, Version = 5
43fb9a8512SAlexander Yermolovich# CHECK-NEXT: "clang version 15.0.0"
44fb9a8512SAlexander Yermolovich# CHECK-NEXT: "main.cpp"
45fb9a8512SAlexander Yermolovich# CHECK-NEXT: "/testLocListMultiple"
46fb9a8512SAlexander Yermolovich# CHECK-NEXT: "_Z3usePiS_"
47fb9a8512SAlexander Yermolovich# CHECK-NEXT: "use"
48fb9a8512SAlexander Yermolovich# CHECK-NEXT: "main"
49fb9a8512SAlexander Yermolovich# CHECK-NEXT: "int"
50fb9a8512SAlexander Yermolovich# CHECK-NEXT: "x"
51fb9a8512SAlexander Yermolovich# CHECK-NEXT: "y"
52fb9a8512SAlexander Yermolovich# CHECK-NEXT: "argc"
53fb9a8512SAlexander Yermolovich# CHECK-NEXT: "argv"
54fb9a8512SAlexander Yermolovich# CHECK-NEXT: "char"
55fb9a8512SAlexander Yermolovich# CHECK-NEXT: 0x00000038: Contribution size = 48, Format = DWARF32, Version = 5
56fb9a8512SAlexander Yermolovich# CHECK-NEXT: "clang version 15.0.0)"
57fb9a8512SAlexander Yermolovich# CHECK-NEXT: "foo.cpp"
58fb9a8512SAlexander Yermolovich# CHECK-NEXT: "/testLocListMultiple"
59fb9a8512SAlexander Yermolovich# CHECK-NEXT: "fooVar"
60fb9a8512SAlexander Yermolovich# CHECK-NEXT: "int"
61fb9a8512SAlexander Yermolovich# CHECK-NEXT: "_Z6useFooPi"
62fb9a8512SAlexander Yermolovich# CHECK-NEXT: "useFoo"
63fb9a8512SAlexander Yermolovich# CHECK-NEXT: "x"
64fb9a8512SAlexander Yermolovich# CHECK-NEXT: "_Z3fooi"
65fb9a8512SAlexander Yermolovich# CHECK-NEXT: "foo"
66fb9a8512SAlexander Yermolovich# CHECK-NEXT: "argc"
67