aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2013-02-05 14:18:59 +0000
committerLogan Chien <tzuhsiang.chien@gmail.com>2013-02-05 14:18:59 +0000
commitb0c899666a6c5397cf35fffd0f8d93749cb2cb38 (patch)
tree51eb9239606199d36aed24bfc275cfca05b7b713 /test/CodeGen/ARM
parente2d5590c33f1b5203c0104c1c82bf8e0f28b828e (diff)
Link .ARM.exidx with corresponding text section.
The sh_link in the ELF section header of .ARM.exidx should be filled with the section index of the corresponding text section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/ARM')
-rw-r--r--test/CodeGen/ARM/ehabi-mc-sh_link.ll47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/ehabi-mc-sh_link.ll b/test/CodeGen/ARM/ehabi-mc-sh_link.ll
new file mode 100644
index 0000000000..f90e5f384c
--- /dev/null
+++ b/test/CodeGen/ARM/ehabi-mc-sh_link.ll
@@ -0,0 +1,47 @@
+; Test the sh_link in Elf32_Shdr.
+
+; The .ARM.exidx section should be linked with corresponding text section.
+; The sh_link in Elf32_Shdr should be filled with the section index of
+; the text section.
+
+; RUN: llc -mtriple arm-unknown-linux-gnueabi \
+; RUN: -arm-enable-ehabi -arm-enable-ehabi-descriptors \
+; RUN: -filetype=obj -o - %s \
+; RUN: | elf-dump --dump-section-data \
+; RUN: | FileCheck %s
+
+define void @test1() nounwind {
+entry:
+ ret void
+}
+
+define void @test2() nounwind section ".test_section" {
+entry:
+ ret void
+}
+
+; CHECK: # Section 1
+; CHECK-NEXT: (('sh_name', 0x00000010) # '.text'
+
+; CHECK: (('sh_name', 0x00000005) # '.ARM.exidx'
+; CHECK-NEXT: ('sh_type', 0x70000001)
+; CHECK-NEXT: ('sh_flags', 0x00000082)
+; CHECK-NEXT: ('sh_addr', 0x00000000)
+; CHECK-NEXT: ('sh_offset', 0x0000005c)
+; CHECK-NEXT: ('sh_size', 0x00000008)
+; CHECK-NEXT: ('sh_link', 0x00000001)
+; CHECK-NEXT: ('sh_info', 0x00000000)
+; CHECK-NEXT: ('sh_addralign', 0x00000004)
+
+; CHECK: # Section 7
+; CHECK-NEXT: (('sh_name', 0x00000039) # '.test_section'
+
+; CHECK: (('sh_name', 0x0000002f) # '.ARM.exidx.test_section'
+; CHECK-NEXT: ('sh_type', 0x70000001)
+; CHECK-NEXT: ('sh_flags', 0x00000082)
+; CHECK-NEXT: ('sh_addr', 0x00000000)
+; CHECK-NEXT: ('sh_offset', 0x00000068)
+; CHECK-NEXT: ('sh_size', 0x00000008)
+; CHECK-NEXT: ('sh_link', 0x00000007)
+; CHECK-NEXT: ('sh_info', 0x00000000)
+; CHECK-NEXT: ('sh_addralign', 0x00000004)