| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 1 | // RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 5 -fdebug-compilation-dir=/tmp | 
| Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 2 | // RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF45 %s | 
| Paul Robinson | 795ab0d | 2017-12-05 20:35:00 +0000 | [diff] [blame] | 3 | // RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -check-prefix DWARF-DL-5 -DDWVER=5 %s | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 4 | // RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC -check-prefix RELOC5 %s | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 5 | // RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -fdebug-compilation-dir=/tmp | 
| Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 6 | // RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF45 %s | 
| Paul Robinson | 795ab0d | 2017-12-05 20:35:00 +0000 | [diff] [blame] | 7 | // RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -DDWVER=4 %s | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 8 | // RUN: llvm-objdump -r %t | FileCheck -check-prefix RELOC -check-prefix RELOC4 %s | 
| Paul Robinson | 22d0d31 | 2015-12-23 01:57:31 +0000 | [diff] [blame] | 9 | // RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 3 -fdebug-compilation-dir=/tmp | 
| Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 10 | // RUN: llvm-dwarfdump -v %t | FileCheck -check-prefix DWARF -check-prefix DWARF3 %s | 
| Paul Robinson | 795ab0d | 2017-12-05 20:35:00 +0000 | [diff] [blame] | 11 | // RUN: llvm-dwarfdump --debug-line %t | FileCheck -check-prefix DWARF-DL -DDWVER=3 %s | 
| Oliver Stannard | 14f97d0 | 2014-09-22 10:45:16 +0000 | [diff] [blame] | 12 | // RUN: llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 2 2>&1 | FileCheck -check-prefix VERSION %s | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 13 | // RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 1 2>&1 | FileCheck -check-prefix DWARF1 %s | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 14 | // RUN: not llvm-mc < %s -triple=armv7-linux-gnueabi -filetype=obj -o %t -g -dwarf-version 6 2>&1 | FileCheck -check-prefix DWARF6 %s | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 15 | .section .text, "ax" | 
|  | 16 | a: | 
|  | 17 | mov r0, r0 | 
|  | 18 |  | 
|  | 19 | .section foo, "ax" | 
|  | 20 | b: | 
|  | 21 | mov r1, r1 | 
|  | 22 |  | 
|  | 23 | // DWARF: .debug_abbrev contents: | 
|  | 24 | // DWARF: Abbrev table for offset: 0x00000000 | 
|  | 25 | // DWARF: [1] DW_TAG_compile_unit DW_CHILDREN_yes | 
| Paul Robinson | 22d0d31 | 2015-12-23 01:57:31 +0000 | [diff] [blame] | 26 | // DWARF3:        DW_AT_stmt_list DW_FORM_data4 | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 27 | // DWARF45:       DW_AT_stmt_list DW_FORM_sec_offset | 
| Paul Robinson | 22d0d31 | 2015-12-23 01:57:31 +0000 | [diff] [blame] | 28 | // DWARF3:        DW_AT_ranges    DW_FORM_data4 | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 29 | // DWARF45:       DW_AT_ranges    DW_FORM_sec_offset | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 30 | // DWARF:         DW_AT_name      DW_FORM_string | 
|  | 31 | // DWARF:         DW_AT_comp_dir  DW_FORM_string | 
|  | 32 | // DWARF:         DW_AT_producer  DW_FORM_string | 
|  | 33 | // DWARF:         DW_AT_language  DW_FORM_data2 | 
|  | 34 |  | 
|  | 35 | // DWARF: .debug_info contents: | 
|  | 36 | // DWARF: 0x{{[0-9a-f]+}}: DW_TAG_compile_unit [1] | 
| Paul Robinson | 22d0d31 | 2015-12-23 01:57:31 +0000 | [diff] [blame] | 37 | // DWARF-NOT: DW_TAG_ | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 38 | // DWARF3:  DW_AT_ranges [DW_FORM_data4]           (0x00000000 | 
|  | 39 | // DWARF45: DW_AT_ranges [DW_FORM_sec_offset]      (0x00000000 | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 40 |  | 
|  | 41 | // DWARF: 0x{{[0-9a-f]+}}:   DW_TAG_label [2] * | 
|  | 42 | // DWARF-NEXT: DW_AT_name [DW_FORM_string]     ("a") | 
|  | 43 |  | 
|  | 44 | // DWARF: 0x{{[0-9a-f]+}}:   DW_TAG_label [2] * | 
|  | 45 | // DWARF-NEXT: DW_AT_name [DW_FORM_string]     ("b") | 
|  | 46 |  | 
|  | 47 |  | 
|  | 48 | // DWARF: .debug_aranges contents: | 
|  | 49 | // DWARF-NEXT: Address Range Header: length = 0x00000024, version = 0x0002, cu_offset = 0x00000000, addr_size = 0x04, seg_size = 0x00 | 
|  | 50 | // DWARF-NEXT: [0x00000000 - 0x00000004) | 
|  | 51 | // DWARF-NEXT: [0x00000000 - 0x00000004) | 
|  | 52 |  | 
|  | 53 |  | 
| Jonas Devlieghere | 26f9a0c | 2017-09-21 20:15:30 +0000 | [diff] [blame] | 54 | // DWARF-DL: .debug_line contents: | 
| Paul Robinson | 795ab0d | 2017-12-05 20:35:00 +0000 | [diff] [blame] | 55 | // DWARF-DL: version: [[DWVER]] | 
|  | 56 | // DWARF-DL-5:    address_size: 4 | 
|  | 57 | // DWARF-DL-5:    include_directories[  1] = '' | 
|  | 58 | // DWARF-DL:      file_names[  1] {{.*}} <stdin> | 
| Jonas Devlieghere | 26f9a0c | 2017-09-21 20:15:30 +0000 | [diff] [blame] | 59 | // DWARF-DL:      0x0000000000000000     17      0      1   0   0  is_stmt | 
|  | 60 | // DWARF-DL-NEXT: 0x0000000000000004     17      0      1   0   0  is_stmt end_sequence | 
|  | 61 | // DWARF-DL-NEXT: 0x0000000000000000     21      0      1   0   0  is_stmt | 
|  | 62 | // DWARF-DL-NEXT: 0x0000000000000004     21      0      1   0   0  is_stmt end_sequence | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 63 |  | 
|  | 64 |  | 
|  | 65 | // DWARF: .debug_ranges contents: | 
|  | 66 | // DWARF: 00000000 ffffffff 00000000 | 
|  | 67 | // DWARF: 00000000 00000000 00000004 | 
|  | 68 | // DWARF: 00000000 ffffffff 00000000 | 
|  | 69 | // DWARF: 00000000 00000000 00000004 | 
|  | 70 | // DWARF: 00000000 <End of list> | 
|  | 71 |  | 
|  | 72 |  | 
|  | 73 |  | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 74 | // Offsets are different in DWARF v5 due to different header layout. | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 75 | // RELOC: RELOCATION RECORDS FOR [.rel.debug_info]: | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 76 | // RELOC4-NEXT: 00000006 R_ARM_ABS32 .debug_abbrev | 
|  | 77 | // RELOC4-NEXT: 0000000c R_ARM_ABS32 .debug_line | 
|  | 78 | // RELOC4-NEXT: 00000010 R_ARM_ABS32 .debug_ranges | 
|  | 79 | // RELOC5-NEXT: 00000008 R_ARM_ABS32 .debug_abbrev | 
|  | 80 | // RELOC5-NEXT: 0000000d R_ARM_ABS32 .debug_line | 
|  | 81 | // RELOC5-NEXT: 00000011 R_ARM_ABS32 .debug_ranges | 
| Eric Christopher | b0a78ca | 2014-06-19 20:00:13 +0000 | [diff] [blame] | 82 | // RELOC-NEXT: R_ARM_ABS32 .text | 
|  | 83 | // RELOC-NEXT: R_ARM_ABS32 foo | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 84 |  | 
|  | 85 | // RELOC: RELOCATION RECORDS FOR [.rel.debug_ranges]: | 
|  | 86 | // RELOC-NEXT: 00000004 R_ARM_ABS32 .text | 
|  | 87 | // RELOC-NEXT: 00000014 R_ARM_ABS32 foo | 
|  | 88 |  | 
|  | 89 | // RELOC: RELOCATION RECORDS FOR [.rel.debug_aranges]: | 
|  | 90 | // RELOC-NEXT: 00000006 R_ARM_ABS32 .debug_info | 
|  | 91 | // RELOC-NEXT: 00000010 R_ARM_ABS32 .text | 
|  | 92 | // RELOC-NEXT: 00000018 R_ARM_ABS32 foo | 
|  | 93 |  | 
|  | 94 |  | 
| Oliver Stannard | 14f97d0 | 2014-09-22 10:45:16 +0000 | [diff] [blame] | 95 | // VERSION: {{.*}} warning: DWARF2 only supports one section per compilation unit | 
| Oliver Stannard | d306c3c | 2014-06-19 16:35:19 +0000 | [diff] [blame] | 96 |  | 
|  | 97 | // DWARF1: Dwarf version 1 is not supported. | 
| Paul Robinson | dccb4fe | 2017-02-28 23:40:46 +0000 | [diff] [blame] | 98 | // DWARF6: Dwarf version 6 is not supported. |