aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-03-10 00:58:25 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-03-10 00:58:25 +0000
commita015c1c876bb74a83cbbae06449056e0c6f0e9c9 (patch)
tree1706557373cac775780582feffc791063c660348 /test/MC
parent7c617b5e53987d786451dd668b5113f2e2b983f8 (diff)
downloadexternal_llvm-a015c1c876bb74a83cbbae06449056e0c6f0e9c9.zip
external_llvm-a015c1c876bb74a83cbbae06449056e0c6f0e9c9.tar.gz
external_llvm-a015c1c876bb74a83cbbae06449056e0c6f0e9c9.tar.bz2
MC/Mach-O: Use the SECTDIFF relocation type for (A - B + constant) where A is external.
- I'm not sure why, but this is what 'as' does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/MachO/reloc-diff.s55
1 files changed, 55 insertions, 0 deletions
diff --git a/test/MC/MachO/reloc-diff.s b/test/MC/MachO/reloc-diff.s
new file mode 100644
index 0000000..601edba
--- /dev/null
+++ b/test/MC/MachO/reloc-diff.s
@@ -0,0 +1,55 @@
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump | FileCheck %s
+
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0xa2000014),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0xa1000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 2
+// CHECK: (('word-0', 0xa4000010),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 3
+// CHECK: (('word-0', 0xa1000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 4
+// CHECK: (('word-0', 0xa400000c),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 5
+// CHECK: (('word-0', 0xa1000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 6
+// CHECK: (('word-0', 0xa4000008),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 7
+// CHECK: (('word-0', 0xa1000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 8
+// CHECK: (('word-0', 0xa4000004),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 9
+// CHECK: (('word-0', 0xa1000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 10
+// CHECK: (('word-0', 0xa2000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK: # Relocation 11
+// CHECK: (('word-0', 0xa1000000),
+// CHECK: ('word-1', 0x0)),
+// CHECK-NEXT: ])
+
+_local_def:
+ .globl _external_def
+_external_def:
+Ltemp:
+ ret
+
+ .data
+ .long _external_def - _local_def
+ .long Ltemp - _local_def
+
+ .long _local_def - _external_def
+ .long Ltemp - _external_def
+
+ .long _local_def - Ltemp
+ .long _external_def - Ltemp