Emit DWARF line entries for all data in the instruction stream.
[oota-llvm.git] / test / MC / ELF / debug-line.s
1 // RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj -s -sd | FileCheck %s
2
3 // Test that .debug_line is populated.  TODO: This test should really be using
4 // llvm-dwarfdump, but it cannot parse this particular object file.  The content
5 // of .debug_line was checked using GNU binutils:
6
7 // $ objdump --dwarf=decodedline debug-line.o
8 // [...]
9 // File name                            Line number    Starting address
10 // foo.c                                          4                   0
11 // foo.c                                          5                 0x4
12 // foo.c                                          6                 0x5
13
14 // CHECK:        Section {
15 // CHECK:          Name: .debug_line
16 // CHECK-NEXT:     Type: SHT_PROGBITS
17 // CHECK-NEXT:     Flags [
18 // CHECK-NEXT:     ]
19 // CHECK-NEXT:     Address: 0x0
20 // CHECK-NEXT:     Offset: 0x50
21 // CHECK-NEXT:     Size: 57
22 // CHECK-NEXT:     Link: 0
23 // CHECK-NEXT:     Info: 0
24 // CHECK-NEXT:     AddressAlignment: 1
25 // CHECK-NEXT:     EntrySize: 0
26 // CHECK-NEXT:     SectionData (
27
28 // CHECK-NEXT:       0000: 35000000 02001C00 00000101 FB0E0D00
29 // CHECK-NEXT:       0010: 01010101 00000001 00000100 666F6F2E
30 // CHECK-NEXT:       0020: 63000000 00000009 02000000 00000000
31 // CHECK-NEXT:       0030: 00154B21 02080001 01
32 // CHECK-NEXT:     )
33 // CHECK-NEXT:   }
34
35         .section        .debug_line,"",@progbits
36         .text
37
38         .file 1 "foo.c"
39         .loc 1 4 0
40         subq    $8, %rsp
41
42 // Test that .loc works with values, not just instructions.
43
44         .loc 1 5 0
45         .byte 0xc3
46
47         .loc 1 6 0
48 l:
49         .quad l