aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJason W Kim <jason.w.kim.2009@gmail.com>2010-12-01 02:40:06 +0000
committerJason W Kim <jason.w.kim.2009@gmail.com>2010-12-01 02:40:06 +0000
commit85fed5e0c5bc010f967948a4af6b425a5a2f2bd0 (patch)
tree339b05440d349244878383e60af94c7952bb28b4 /test
parent0480e28fb2a7d4e140d56c39e9705c922456585c (diff)
downloadexternal_llvm-85fed5e0c5bc010f967948a4af6b425a5a2f2bd0.zip
external_llvm-85fed5e0c5bc010f967948a4af6b425a5a2f2bd0.tar.gz
external_llvm-85fed5e0c5bc010f967948a4af6b425a5a2f2bd0.tar.bz2
ARM/MC/ELF relocation "hello world" for movw/movt.
Lifted adjustFixupValue() from Darwin for sharing w ELF. Test added TODO: refactor ELFObjectWriter::RecordRelocation more. Possibly share more code with Darwin? Lots more relocations... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120534 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/2010-11-30-reloc-movt.ll42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/2010-11-30-reloc-movt.ll b/test/CodeGen/ARM/2010-11-30-reloc-movt.ll
new file mode 100644
index 0000000..a8dc52e
--- /dev/null
+++ b/test/CodeGen/ARM/2010-11-30-reloc-movt.ll
@@ -0,0 +1,42 @@
+; RUN: llc %s -mtriple=armv7-linux-gnueabi -arm-use-movt -filetype=obj -o - | \
+; RUN: elf-dump --dump-section-data | FileCheck -check-prefix=OBJ %s
+
+target triple = "armv7-none-linux-gnueabi"
+
+@a = external global i8
+
+define arm_aapcs_vfpcc i32 @barf() nounwind {
+entry:
+ %0 = tail call arm_aapcs_vfpcc i32 @foo(i8* @a) nounwind
+ ret i32 %0
+; OBJ: '.text'
+; OBJ-NEXT: 'sh_type'
+; OBJ-NEXT: 'sh_flags'
+; OBJ-NEXT: 'sh_addr'
+; OBJ-NEXT: 'sh_offset'
+; OBJ-NEXT: 'sh_size'
+; OBJ-NEXT: 'sh_link'
+; OBJ-NEXT: 'sh_info'
+; OBJ-NEXT: 'sh_addralign'
+; OBJ-NEXT: 'sh_entsize'
+; OBJ-NEXT: '_section_data', '00482de9 000000e3 000040e3 feffffeb 0088bde8'
+
+; OBJ: Relocation 0x00000000
+; OBJ-NEXT: 'r_offset', 0x00000004
+; OBJ-NEXT: 'r_sym', 0x00000007
+; OBJ-NEXT: 'r_type', 0x0000002b
+
+; OBJ: Relocation 0x00000001
+; OBJ-NEXT: 'r_offset', 0x00000008
+; OBJ-NEXT: 'r_sym'
+; OBJ-NEXT: 'r_type', 0x0000002c
+
+; OBJ: # Relocation 0x00000002
+; OBJ-NEXT: 'r_offset', 0x0000000c
+; OBJ-NEXT: 'r_sym', 0x00000008
+; OBJ-NEXT: 'r_type', 0x0000001c
+
+}
+
+declare arm_aapcs_vfpcc i32 @foo(i8*)
+