aboutsummaryrefslogtreecommitdiff
path: root/test/MC/ELF
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-06-12 15:42:51 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-06-12 15:42:51 +0000
commit56fe8f14099930935e3870e3e823c322a85c1c89 (patch)
treeb3032e51d630e8070e9e08d6641648f195316a80 /test/MC/ELF
parent6b943ff3a3f8617113ecbf611cf0f8957e4e19d2 (diff)
downloadsrc-56fe8f14099930935e3870e3e823c322a85c1c89.tar.gz
src-56fe8f14099930935e3870e3e823c322a85c1c89.zip
Vendor import of llvm trunk r132879:vendor/llvm/llvm-r132879
Notes
Notes: svn path=/vendor/llvm/dist/; revision=223013 svn path=/vendor/llvm/llvm-r132879/; revision=223014; tag=vendor/llvm/llvm-r132879
Diffstat (limited to 'test/MC/ELF')
-rw-r--r--test/MC/ELF/cfi-offset.s2
-rw-r--r--test/MC/ELF/cfi-sections.s38
-rw-r--r--test/MC/ELF/relocation-386.s8
-rw-r--r--test/MC/ELF/relocation.s7
4 files changed, 54 insertions, 1 deletions
diff --git a/test/MC/ELF/cfi-offset.s b/test/MC/ELF/cfi-offset.s
index 963a76c1fca6..f54dec0ec8ad 100644
--- a/test/MC/ELF/cfi-offset.s
+++ b/test/MC/ELF/cfi-offset.s
@@ -3,7 +3,7 @@
f:
.cfi_startproc
nop
- .cfi_offset %ebp, -16
+ .cfi_offset %rbp, -16
nop
.cfi_endproc
diff --git a/test/MC/ELF/cfi-sections.s b/test/MC/ELF/cfi-sections.s
new file mode 100644
index 000000000000..a73f3a9f5866
--- /dev/null
+++ b/test/MC/ELF/cfi-sections.s
@@ -0,0 +1,38 @@
+// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_64 %s
+// RUN: llvm-mc -filetype=obj -triple i686-pc-linux-gnu %s -o - | elf-dump --dump-section-data | FileCheck -check-prefix=ELF_32 %s
+
+.cfi_sections .debug_frame
+
+f1:
+ .cfi_startproc
+ nop
+ .cfi_endproc
+
+f2:
+ .cfi_startproc
+ nop
+ .cfi_endproc
+
+// ELF_64: (('sh_name', 0x00000011) # '.debug_frame'
+// ELF_64-NEXT: ('sh_type', 0x00000001)
+// ELF_64-NEXT: ('sh_flags', 0x00000000)
+// ELF_64-NEXT: ('sh_addr', 0x00000000)
+// ELF_64-NEXT: ('sh_offset', 0x00000048)
+// ELF_64-NEXT: ('sh_size', 0x00000048)
+// ELF_64-NEXT: ('sh_link', 0x00000000)
+// ELF_64-NEXT: ('sh_info', 0x00000000)
+// ELF_64-NEXT: ('sh_addralign', 0x00000008)
+// ELF_64-NEXT: ('sh_entsize', 0x00000000)
+// ELF_64-NEXT: ('_section_data', '14000000 ffffffff 01000178 100c0708 90010000 00000000 14000000 00000000 00000000 00000000 01000000 00000000 14000000 00000000 00000000 00000000 01000000 00000000')
+
+// ELF_32: (('sh_name', 0x00000010) # '.debug_frame'
+// ELF_32-NEXT: ('sh_type', 0x00000001)
+// ELF_32-NEXT: ('sh_flags', 0x00000000)
+// ELF_32-NEXT: ('sh_addr', 0x00000000)
+// ELF_32-NEXT: ('sh_offset', 0x00000038)
+// ELF_32-NEXT: ('sh_size', 0x00000034)
+// ELF_32-NEXT: ('sh_link', 0x00000000)
+// ELF_32-NEXT: ('sh_info', 0x00000000)
+// ELF_32-NEXT: ('sh_addralign', 0x00000004)
+// ELF_32-NEXT: ('sh_entsize', 0x00000000)
+// ELF_32-NEXT: ('_section_data', '10000000 ffffffff 0100017c 080c0404 88010000 0c000000 00000000 00000000 01000000 0c000000 00000000 01000000 01000000')
diff --git a/test/MC/ELF/relocation-386.s b/test/MC/ELF/relocation-386.s
index f7b20b56ba53..25f3450d44d9 100644
--- a/test/MC/ELF/relocation-386.s
+++ b/test/MC/ELF/relocation-386.s
@@ -153,6 +153,13 @@
// CHECK-NEXT: ('r_sym',
// CHECK-NEXT: ('r_type', 0x00000001)
// CHECK-NEXT: ),
+// Relocation 24 (foo@GOTTPOFF(%edx)) is of type R_386_TLS_IE_32 and uses the
+// symbol
+// CHECK-NEXT: Relocation 0x00000018
+// CHECK-NEXT: (('r_offset', 0x0000008e)
+// CHECK-NEXT: ('r_sym', 0x0000000d)
+// CHECK-NEXT: ('r_type', 0x00000021)
+// CHECK-NEXT: ),
// Section 4 is bss
// CHECK: # Section 0x00000004
@@ -217,6 +224,7 @@ bar2:
movl zed@TPOFF(%eax), %eax
movl zed@DTPOFF(%eax), %eax
pushl $bar
+ addl foo@GOTTPOFF(%edx), %eax
.section zedsec,"awT",@progbits
zed:
diff --git a/test/MC/ELF/relocation.s b/test/MC/ELF/relocation.s
index 4df09e13fce0..2760232a5a80 100644
--- a/test/MC/ELF/relocation.s
+++ b/test/MC/ELF/relocation.s
@@ -17,6 +17,7 @@ bar:
pushq $bar
movq foo(%rip), %rdx
leaq foo-bar(%r14),%r14
+ addq $bar,%rax # R_X86_64_32S
// CHECK: # Section 0x00000001
@@ -106,6 +107,12 @@ bar:
// CHECK-NEXT: ('r_type', 0x00000002)
// CHECK-NEXT: ('r_addend', 0x0000005c)
+// CHECK: # Relocation 0x0000000e
+// CHECK-NEXT: (('r_offset', 0x00000063)
+// CHECK-NEXT: ('r_sym', 0x00000002)
+// CHECK-NEXT: ('r_type', 0x0000000b)
+// CHECK-NEXT: ('r_addend', 0x00000000)
+
// CHECK: # Symbol 0x00000002
// CHECK: (('st_name', 0x00000000) # ''
// CHECK: ('st_bind', 0x00000000)