summaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-11-14 09:55:38 +0000
committerAlexey Samsonov <samsonov@google.com>2012-11-14 09:55:38 +0000
commit15ab115df57949fa55d92ffdfba491f7d02ed60f (patch)
tree14092148386f5a8934fbf41a657e29a3fff9e6a5 /test/MC
parent1e65676a12c61815acb65990d9269611ad544c78 (diff)
downloadllvm-15ab115df57949fa55d92ffdfba491f7d02ed60f.tar.gz
llvm-15ab115df57949fa55d92ffdfba491f7d02ed60f.tar.bz2
llvm-15ab115df57949fa55d92ffdfba491f7d02ed60f.tar.xz
Emit relocations from .debug_aranges to .debug_info for asm files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167926 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/ELF/gen-dwarf.s44
1 files changed, 42 insertions, 2 deletions
diff --git a/test/MC/ELF/gen-dwarf.s b/test/MC/ELF/gen-dwarf.s
index b090e0802b..85e02428fe 100644
--- a/test/MC/ELF/gen-dwarf.s
+++ b/test/MC/ELF/gen-dwarf.s
@@ -1,8 +1,9 @@
// RUN: llvm-mc -g -triple i686-pc-linux-gnu %s -filetype=obj -o - | elf-dump | FileCheck %s
-// Test that on ELF the debug info has a relocation to debug_abbrev and one to
-// to debug_line.
+// Test that on ELF:
+// 1. the debug info has a relocation to debug_abbrev and one to to debug_line.
+// 2. the debug_aranges has relocations to text and debug_line.
.text
@@ -47,6 +48,34 @@ foo:
// CHECK: # Section 8
// CHECK-NEXT: (('sh_name', 0x00000001) # '.debug_abbrev'
+// Section 9 is .debug_aranges
+// CHECK: # Section 9
+// CHECK-NEXT: (('sh_name', 0x0000001e) # '.debug_aranges'
+
+// Two relocations in .debug_aranges, one to text and one to debug_info.
+// CHECK: # '.rel.debug_aranges'
+// CHECK: # Relocation 0
+// CHECK-NEXT: (('r_offset', 0x00000006)
+// CHECK-NEXT: ('r_sym', 0x000005)
+// CHECK-NEXT: ('r_type', 0x01)
+// CHECK-NEXT: ),
+// CHECK-NEXT: # Relocation 1
+// CHECK-NEXT: (('r_offset', 0x00000010)
+// CHECK-NEXT: ('r_sym', 0x000001)
+// CHECK-NEXT: ('r_type', 0x01)
+// CHECK-NEXT: ),
+
+// Symbol 1 is section 1 (.text)
+// CHECK: # Symbol 1
+// CHECK-NEXT: (('st_name', 0x00000000) # ''
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x0)
+// CHECK-NEXT: ('st_type', 0x3)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0001)
+// CHECK-NEXT: ),
+
// Symbol 4 is section 4 (.debug_line)
// CHECK: # Symbol 4
// CHECK-NEXT: (('st_name', 0x00000000) # ''
@@ -58,6 +87,17 @@ foo:
// CHECK-NEXT: ('st_shndx', 0x0004)
// CHECK-NEXT: ),
+// Symbol 5 is section 6 (.debug_info)
+// CHECK: # Symbol 5
+// CHECK-NEXT: (('st_name', 0x00000000) # ''
+// CHECK-NEXT: ('st_value', 0x00000000)
+// CHECK-NEXT: ('st_size', 0x00000000)
+// CHECK-NEXT: ('st_bind', 0x0)
+// CHECK-NEXT: ('st_type', 0x3)
+// CHECK-NEXT: ('st_other', 0x00)
+// CHECK-NEXT: ('st_shndx', 0x0006)
+// CHECK-NEXT: ),
+
// Symbol 6 is section 8 (.debug_abbrev)
// CHECK: # Symbol 6
// CHECK-NEXT: (('st_name', 0x00000000) # ''