summaryrefslogtreecommitdiffstats
path: root/test/MC/MachO/ARM
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC/MachO/ARM')
-rw-r--r--test/MC/MachO/ARM/data-in-code.s33
-rw-r--r--test/MC/MachO/ARM/llvm-objdump-macho-stripped.s5
-rw-r--r--test/MC/MachO/ARM/llvm-objdump-macho.s20
-rw-r--r--test/MC/MachO/ARM/thumb-bl-jbits.s19
-rw-r--r--test/MC/MachO/ARM/thumb2-movw-fixup.s44
5 files changed, 121 insertions, 0 deletions
diff --git a/test/MC/MachO/ARM/data-in-code.s b/test/MC/MachO/ARM/data-in-code.s
new file mode 100644
index 0000000..bbcb9aa
--- /dev/null
+++ b/test/MC/MachO/ARM/data-in-code.s
@@ -0,0 +1,33 @@
+@ RUN: llvm-mc -triple armv7-apple-darwin10 -filetype=obj -o - < %s | macho-dump | FileCheck %s
+ .text
+_foo:
+@ CHECK: # DICE 0
+@ CHECK: ('offset', 0)
+@ CHECK: ('length', 4)
+@ CHECK: ('kind', 1)
+@ CHECK: # DICE 1
+@ CHECK: ('offset', 4)
+@ CHECK: ('length', 4)
+@ CHECK: ('kind', 4)
+@ CHECK: # DICE 2
+@ CHECK: ('offset', 8)
+@ CHECK: ('length', 2)
+@ CHECK: ('kind', 3)
+@ CHECK: # DICE 3
+@ CHECK: ('offset', 10)
+@ CHECK: ('length', 1)
+@ CHECK: ('kind', 2)
+
+.data_region
+ .long 10
+.end_data_region
+.data_region jt32
+ .long 1
+.end_data_region
+.data_region jt16
+ .short 2
+.end_data_region
+.data_region jt8
+ .byte 3
+.end_data_region
+
diff --git a/test/MC/MachO/ARM/llvm-objdump-macho-stripped.s b/test/MC/MachO/ARM/llvm-objdump-macho-stripped.s
new file mode 100644
index 0000000..7fcec52
--- /dev/null
+++ b/test/MC/MachO/ARM/llvm-objdump-macho-stripped.s
@@ -0,0 +1,5 @@
+@ RUN: llvm-mc -triple=thumbv7-apple-ios -filetype=obj -o - < %s | llvm-objdump -d -macho -triple=thumbv7-apple-ios - | FileCheck %s
+ nop
+# CHECK: 0: 00 bf nop
+# We are checking that disassembly happens when there are no symbols.
+# rdar://11460289
diff --git a/test/MC/MachO/ARM/llvm-objdump-macho.s b/test/MC/MachO/ARM/llvm-objdump-macho.s
new file mode 100644
index 0000000..c8aec93
--- /dev/null
+++ b/test/MC/MachO/ARM/llvm-objdump-macho.s
@@ -0,0 +1,20 @@
+@ RUN: llvm-mc -triple=thumbv7-apple-ios -filetype=obj -o - < %s | llvm-objdump -d -macho -triple=thumbv7-apple-ios - | FileCheck %s
+.thumb
+.thumb_func _fib
+_fib:
+ push {r7, lr}
+ pop {r7, pc}
+.thumb_func _main
+_main:
+ push {r7, lr}
+ pop {r7, pc}
+ nop
+# CHECK: _fib:
+# CHECK: 0: 80 b5 push {r7, lr}
+# CHECK: 2: 80 bd pop {r7, pc}
+# CHECK: _main:
+# CHECK: 4: 80 b5 push {r7, lr}
+# CHECK: 6: 80 bd pop {r7, pc}
+# CHECK: 8: 00 bf nop
+# We are checking that second function is fully disassembled.
+# rdar://11426465
diff --git a/test/MC/MachO/ARM/thumb-bl-jbits.s b/test/MC/MachO/ARM/thumb-bl-jbits.s
new file mode 100644
index 0000000..9657968
--- /dev/null
+++ b/test/MC/MachO/ARM/thumb-bl-jbits.s
@@ -0,0 +1,19 @@
+@ RUN: llvm-mc -triple=thumbv7-apple-darwin -filetype=obj -o - < %s | macho-dump --dump-section-data | FileCheck %s
+.thumb
+.thumb_func t
+t: nop
+
+.data
+.space 4441096 - 4 - 2
+
+.section __TEXT, __branch, regular, pure_instructions
+.thumb
+.thumb_func b
+b:
+ bl t
+# CHECK: '_section_data', 'c3f7fcf5'
+# We are checking that the branch and link instruction which is:
+# bl #-4441096
+# has it displacement encoded correctly with respect to the J1 and J2 bits when
+# the branch is assembled with a label not a displacement.
+# rdar://10149689
diff --git a/test/MC/MachO/ARM/thumb2-movw-fixup.s b/test/MC/MachO/ARM/thumb2-movw-fixup.s
new file mode 100644
index 0000000..57973a8
--- /dev/null
+++ b/test/MC/MachO/ARM/thumb2-movw-fixup.s
@@ -0,0 +1,44 @@
+@ RUN: llvm-mc -mcpu=cortex-a8 -triple thumbv7-apple-darwin10 -filetype=obj -o - < %s | macho-dump | FileCheck %s
+
+@ rdar://10038370
+
+ .syntax unified
+ .text
+ .align 2
+ .code 16
+ .thumb_func _foo
+ movw r2, :lower16:L1
+ movt r2, :upper16:L1
+ movw r12, :lower16:L2
+ movt r12, :upper16:L2
+ .space 70000
+
+ .data
+L1: .long 0
+L2: .long 0
+
+@ CHECK: ('_relocations', [
+@ CHECK: # Relocation 0
+@ CHECK: (('word-0', 0xc),
+@ CHECK: ('word-1', 0x86000002)),
+@ CHECK: # Relocation 1
+@ CHECK: (('word-0', 0x1184),
+@ CHECK: ('word-1', 0x16ffffff)),
+@ CHECK: # Relocation 2
+@ CHECK: (('word-0', 0x8),
+@ CHECK: ('word-1', 0x84000002)),
+@ CHECK: # Relocation 3
+@ CHECK: (('word-0', 0x1),
+@ CHECK: ('word-1', 0x14ffffff)),
+@ CHECK: # Relocation 4
+@ CHECK: (('word-0', 0x4),
+@ CHECK: ('word-1', 0x86000002)),
+@ CHECK: # Relocation 5
+@ CHECK: (('word-0', 0x1180),
+@ CHECK: ('word-1', 0x16ffffff)),
+@ CHECK: # Relocation 6
+@ CHECK: (('word-0', 0x0),
+@ CHECK: ('word-1', 0x84000002)),
+@ CHECK: # Relocation 7
+@ CHECK: (('word-0', 0x1),
+@ CHECK: ('word-1', 0x14ffffff)),
OpenPOWER on IntegriCloud