|
20 | 20 |
|
21 | 21 | ; RUN: llc -dwarf-version=5 -split-dwarf-file=foo.dwo -O0 -mtriple=riscv64-unknown-linux-gnu -filetype=obj relax_dwo_ranges.ll -o %t.o |
22 | 22 | ; RUN: llvm-dwarfdump -v %t.o | FileCheck --check-prefix=DWARF5 %s |
23 | | -; RUN: llvm-dwarfdump --debug-info %t.o 2> %t.txt |
24 | | -; RUN: FileCheck --input-file=%t.txt %s --check-prefix=RELOCS --implicit-check-not=warning: |
| 23 | +; RUN: llvm-dwarfdump --debug-info %t.o > /dev/null 2>&1 | count 0 |
| 24 | +; RUN: llvm-objdump -h %t.o | FileCheck --check-prefix=HDR %s |
25 | 25 |
|
26 | 26 | ; RUN: llc -dwarf-version=4 -split-dwarf-file=foo.dwo -O0 -mtriple=riscv64-unknown-linux-gnu -filetype=obj relax_dwo_ranges.ll -o %t.o |
27 | 27 | ; RUN: llvm-dwarfdump -v %t.o | FileCheck --check-prefix=DWARF4 %s |
28 | | -; RUN: llvm-dwarfdump --debug-info %t.o 2> %t.txt |
29 | | -; RUN: FileCheck --input-file=%t.txt %s --check-prefix=RELOCS --implicit-check-not=warning: |
| 28 | +; RUN: llvm-dwarfdump --debug-info %t.o > /dev/null 2>&1 | count 0 |
| 29 | +; RUN: llvm-objdump -h %t.o | FileCheck --check-prefix=HDR %s |
30 | 30 |
|
31 | | -; Currently, square() still uses an offset to represent the function's end address, |
32 | | -; which requires a relocation here. |
33 | | -; RELOCS: warning: unexpected relocations for dwo section '.debug_info.dwo' |
| 31 | +; Make sure we don't produce any relocations in any .dwo section |
| 32 | +; HDR-NOT: .rela.{{.*}}.dwo |
34 | 33 |
|
| 34 | +; Ensure that 'square()' function uses indexed start and end addresses |
35 | 35 | ; DWARF5: .debug_info.dwo contents: |
36 | 36 | ; DWARF5: DW_TAG_subprogram |
37 | | -; DWARF5-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000000 ".text") |
38 | | -; DWARF5-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000000) |
39 | | -; DWARF5: DW_AT_name {{.*}} "square") |
| 37 | +; DWARF5-NEXT: DW_AT_low_pc [DW_FORM_addrx] (indexed (00000000) address = 0x0000000000000000 ".text") |
| 38 | +; DWARF5-NEXT: DW_AT_high_pc [DW_FORM_addrx] (indexed (00000001) address = 0x000000000000002c ".text") |
| 39 | +; DWARF5: DW_AT_name {{.*}} "square") |
40 | 40 | ; DWARF5: DW_TAG_formal_parameter |
41 | 41 |
|
| 42 | +; HDR-NOT: .rela.{{.*}}.dwo |
| 43 | + |
42 | 44 | ; Ensure there is no unnecessary addresses in .o file |
43 | 45 | ; DWARF5: .debug_addr contents: |
44 | 46 | ; DWARF5: Addrs: [ |
45 | 47 | ; DWARF5-NEXT: 0x0000000000000000 |
46 | 48 | ; DWARF5-NEXT: 0x000000000000002c |
| 49 | +; DWARF5-NEXT: 0x000000000000002c |
47 | 50 | ; DWARF5-NEXT: 0x000000000000003e |
48 | 51 | ; DWARF5-NEXT: 0x000000000000006e |
49 | 52 | ; DWARF5-NEXT: ] |
50 | 53 |
|
| 54 | +; HDR-NOT: .rela.{{.*}}.dwo |
| 55 | + |
51 | 56 | ; Ensure that 'boo()' and 'main()' use DW_RLE_startx_length and DW_RLE_startx_endx |
52 | 57 | ; entries respectively |
53 | 58 | ; DWARF5: .debug_rnglists.dwo contents: |
54 | 59 | ; DWARF5: ranges: |
55 | | -; DWARF5-NEXT: 0x00000014: [DW_RLE_startx_length]: 0x0000000000000001, 0x0000000000000012 => [0x000000000000002c, 0x000000000000003e) |
| 60 | +; DWARF5-NEXT: 0x00000014: [DW_RLE_startx_length]: 0x0000000000000002, 0x0000000000000012 => [0x000000000000002c, 0x000000000000003e) |
56 | 61 | ; DWARF5-NEXT: 0x00000017: [DW_RLE_end_of_list ] |
57 | | -; DWARF5-NEXT: 0x00000018: [DW_RLE_startx_endx ]: 0x0000000000000002, 0x0000000000000003 => [0x000000000000003e, 0x000000000000006e) |
| 62 | +; DWARF5-NEXT: 0x00000018: [DW_RLE_startx_endx ]: 0x0000000000000003, 0x0000000000000004 => [0x000000000000003e, 0x000000000000006e) |
58 | 63 | ; DWARF5-NEXT: 0x0000001b: [DW_RLE_end_of_list ] |
59 | 64 | ; DWARF5-EMPTY: |
60 | 65 |
|
| 66 | +; HDR-NOT: .rela.{{.*}}.dwo |
| 67 | + |
61 | 68 | ; DWARF4: .debug_info.dwo contents: |
62 | 69 | ; DWARF4: DW_TAG_subprogram |
63 | | -; DWARF4-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) address = 0x0000000000000000 ".text") |
64 | | -; DWARF4-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000000) |
65 | | -; DWARF4: DW_AT_name {{.*}} "square") |
| 70 | +; DWARF4-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000000) address = 0x0000000000000000 ".text") |
| 71 | +; DWARF4-NEXT: DW_AT_high_pc [DW_FORM_GNU_addr_index] (indexed (00000001) address = 0x000000000000002c ".text") |
| 72 | +; DWARF4: DW_AT_name {{.*}} "square") |
66 | 73 |
|
67 | 74 | ; DWARF4: DW_TAG_subprogram |
68 | | -; DWARF4-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000001) address = 0x000000000000002c ".text") |
| 75 | +; DWARF4-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000002) address = 0x000000000000002c ".text") |
69 | 76 | ; DWARF4-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000012) |
70 | | -; DWARF4: DW_AT_name {{.*}} "boo") |
| 77 | +; DWARF4: DW_AT_name {{.*}} "boo") |
71 | 78 |
|
72 | 79 | ; DWARF4: DW_TAG_subprogram |
73 | | -; DWARF4-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000002) address = 0x000000000000003e ".text") |
74 | | -; DWARF4-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000000) |
75 | | -; DWARF4: DW_AT_name {{.*}} "main") |
| 80 | +; DWARF4-NEXT: DW_AT_low_pc [DW_FORM_GNU_addr_index] (indexed (00000003) address = 0x000000000000003e ".text") |
| 81 | +; DWARF4-NEXT: DW_AT_high_pc [DW_FORM_GNU_addr_index] (indexed (00000004) address = 0x000000000000006e ".text") |
| 82 | +; DWARF4: DW_AT_name {{.*}} "main") |
| 83 | + |
| 84 | +; HDR-NOT: .rela.{{.*}}.dwo |
76 | 85 |
|
77 | 86 | ; Ensure there is no unnecessary addresses in .o file |
78 | 87 | ; DWARF4: .debug_addr contents: |
79 | 88 | ; DWARF4: Addrs: [ |
80 | 89 | ; DWARF4-NEXT: 0x0000000000000000 |
81 | 90 | ; DWARF4-NEXT: 0x000000000000002c |
| 91 | +; DWARF4-NEXT: 0x000000000000002c |
82 | 92 | ; DWARF4-NEXT: 0x000000000000003e |
| 93 | +; DWARF4-NEXT: 0x000000000000006e |
83 | 94 | ; DWARF4-NEXT: ] |
84 | 95 |
|
| 96 | +; HDR-NOT: .rela.{{.*}}.dwo |
| 97 | + |
85 | 98 | #--- relax_dwo_ranges.cpp |
86 | 99 | __attribute__((noinline)) int boo(); |
87 | 100 |
|
|
0 commit comments