aboutsummaryrefslogtreecommitdiff
path: root/test/MC
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2013-02-16 00:32:53 +0000
committerJoerg Sonnenberger <joerg@bec.de>2013-02-16 00:32:53 +0000
commit42edeb1ba8aabcbe0e5cc846d9e5f2a9e2261292 (patch)
treeba98a2a1fc1dc2e619fd5961469ee00999cabe84 /test/MC
parentabbf9df7f42e8e3e95b02b16ebbc6a0684bb4f6d (diff)
Derive ELF section type from the name in some cases where GNU as does
so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/AsmParser/section_names.s62
1 files changed, 62 insertions, 0 deletions
diff --git a/test/MC/AsmParser/section_names.s b/test/MC/AsmParser/section_names.s
new file mode 100644
index 0000000000..332cdbe3fe
--- /dev/null
+++ b/test/MC/AsmParser/section_names.s
@@ -0,0 +1,62 @@
+# RUN: llvm-mc -triple i386-pc-linux-gnu -filetype=obj -o %t %s
+# RUN: elf-dump --dump-section-data < %t | FileCheck %s
+.section .nobits
+.byte 1
+.section .nobits2
+.byte 1
+.section .nobitsfoo
+.byte 1
+.section .init_array
+.byte 1
+.section .init_array2
+.byte 1
+.section .init_arrayfoo
+.byte 1
+.section .fini_array
+.byte 1
+.section .fini_array2
+.byte 1
+.section .fini_arrayfoo
+.byte 1
+.section .preinit_array
+.byte 1
+.section .preinit_array2
+.byte 1
+.section .preinit_arrayfoo
+.byte 1
+.section .note
+.byte 1
+.section .note2
+.byte 1
+.section .notefoo
+.byte 1
+# CHECK: (('sh_name', 0x00000{{...}}) # '.nobits'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.nobits2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.nobitsfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.init_array'
+# CHECK-NEXT: ('sh_type', 0x0000000e)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.init_array2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.init_arrayfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.fini_array'
+# CHECK-NEXT: ('sh_type', 0x0000000f)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.fini_array2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.fini_arrayfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.preinit_array'
+# CHECK-NEXT: ('sh_type', 0x00000010)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.preinit_array2'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.preinit_arrayfoo'
+# CHECK-NEXT: ('sh_type', 0x00000001)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.note'
+# CHECK-NEXT: ('sh_type', 0x00000007)
+# CHECK: (('sh_name', 0x00000{{...}}) # '.note2'
+# CHECK-NEXT: ('sh_type', 0x00000007)
+#CHECK: (('sh_name', 0x00000{{...}}) # '.notefoo'
+# CHECK-NEXT: ('sh_type', 0x00000007)