summaryrefslogtreecommitdiffstats
path: root/test/MC
diff options
context:
space:
mode:
Diffstat (limited to 'test/MC')
-rw-r--r--test/MC/AsmParser/X86/x86_32-bit_cat.s47
-rw-r--r--test/MC/AsmParser/X86/x86_32-encoding.s44
-rw-r--r--test/MC/AsmParser/X86/x86_64-encoding.s73
-rw-r--r--test/MC/AsmParser/X86/x86_64-incl_decl.s26
-rw-r--r--test/MC/AsmParser/X86/x86_64-new-encoder.s27
-rw-r--r--test/MC/MachO/Darwin/dg.exp5
-rw-r--r--test/MC/MachO/Darwin/x86_32_diff_as.s551
-rw-r--r--test/MC/MachO/darwin-x86_64-diff-relocs.s329
-rw-r--r--test/MC/MachO/darwin-x86_64-reloc-offsets.s343
-rw-r--r--test/MC/MachO/darwin-x86_64-reloc.s229
-rw-r--r--test/MC/MachO/reloc.s118
-rw-r--r--test/MC/MachO/x86_32-optimal_nop.s (renamed from test/MC/MachO/Darwin/optimal_nop.s)47
12 files changed, 1206 insertions, 633 deletions
diff --git a/test/MC/AsmParser/X86/x86_32-bit_cat.s b/test/MC/AsmParser/X86/x86_32-bit_cat.s
index 5429e8e..e910c65 100644
--- a/test/MC/AsmParser/X86/x86_32-bit_cat.s
+++ b/test/MC/AsmParser/X86/x86_32-bit_cat.s
@@ -7756,41 +7756,38 @@
// CHECK: ptest %xmm5, %xmm5
ptest %xmm5,%xmm5
-// CHECK: crc32 3735928559(%ebx,%ecx,8), %ecx
- crc32 0xdeadbeef(%ebx,%ecx,8),%ecx
+// CHECK: crc32b %bl, %eax
+ crc32b %bl, %eax
-// CHECK: crc32 69, %ecx
- crc32 0x45,%ecx
+// CHECK: crc32b 4(%ebx), %eax
+ crc32b 4(%ebx), %eax
-// CHECK: crc32 32493, %ecx
- crc32 0x7eed,%ecx
+// CHECK: crc32w %bx, %eax
+ crc32w %bx, %eax
-// CHECK: crc32 3133065982, %ecx
- crc32 0xbabecafe,%ecx
+// CHECK: crc32w 4(%ebx), %eax
+ crc32w 4(%ebx), %eax
-// CHECK: crc32 305419896, %ecx
- crc32 0x12345678,%ecx
+// CHECK: crc32l %ebx, %eax
+ crc32l %ebx, %eax
-// CHECK: crc32 %ecx, %ecx
- crc32 %ecx,%ecx
+// CHECK: crc32l 4(%ebx), %eax
+ crc32l 4(%ebx), %eax
-// CHECK: crc32 %ecx, %ecx
- crc32 %ecx,%ecx
+// CHECK: crc32l 3735928559(%ebx,%ecx,8), %ecx
+ crc32l 0xdeadbeef(%ebx,%ecx,8),%ecx
-// CHECK: crc32 3735928559(%ebx,%ecx,8), %ecx
- crc32 0xdeadbeef(%ebx,%ecx,8),%ecx
+// CHECK: crc32l 69, %ecx
+ crc32l 0x45,%ecx
-// CHECK: crc32 69, %ecx
- crc32 0x45,%ecx
+// CHECK: crc32l 32493, %ecx
+ crc32l 0x7eed,%ecx
-// CHECK: crc32 32493, %ecx
- crc32 0x7eed,%ecx
+// CHECK: crc32l 3133065982, %ecx
+ crc32l 0xbabecafe,%ecx
-// CHECK: crc32 3133065982, %ecx
- crc32 0xbabecafe,%ecx
-
-// CHECK: crc32 305419896, %ecx
- crc32 0x12345678,%ecx
+// CHECK: crc32l %ecx, %ecx
+ crc32l %ecx,%ecx
// CHECK: pcmpgtq 3735928559(%ebx,%ecx,8), %xmm5
pcmpgtq 0xdeadbeef(%ebx,%ecx,8),%xmm5
diff --git a/test/MC/AsmParser/X86/x86_32-encoding.s b/test/MC/AsmParser/X86/x86_32-encoding.s
index 7dacc75..2088aa7b 100644
--- a/test/MC/AsmParser/X86/x86_32-encoding.s
+++ b/test/MC/AsmParser/X86/x86_32-encoding.s
@@ -9861,3 +9861,47 @@
// CHECK: pcmpgtq %xmm5, %xmm5
// CHECK: encoding: [0x66,0x0f,0x38,0x37,0xed]
pcmpgtq %xmm5,%xmm5
+
+// CHECK: crc32b %bl, %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0xc3]
+ crc32b %bl, %eax
+
+// CHECK: crc32b 4(%ebx), %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
+ crc32b 4(%ebx), %eax
+
+// CHECK: crc32w %bx, %eax
+// CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0xc3]
+ crc32w %bx, %eax
+
+// CHECK: crc32w 4(%ebx), %eax
+// CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0x43,0x04]
+ crc32w 4(%ebx), %eax
+
+// CHECK: crc32l %ebx, %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc3]
+ crc32l %ebx, %eax
+
+// CHECK: crc32l 4(%ebx), %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x43,0x04]
+ crc32l 4(%ebx), %eax
+
+// CHECK: crc32l 3735928559(%ebx,%ecx,8), %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x8c,0xcb,0xef,0xbe,0xad,0xde]
+ crc32l 0xdeadbeef(%ebx,%ecx,8),%ecx
+
+// CHECK: crc32l 69, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0d,0x45,0x00,0x00,0x00]
+ crc32l 0x45,%ecx
+
+// CHECK: crc32l 32493, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0d,0xed,0x7e,0x00,0x00]
+ crc32l 0x7eed,%ecx
+
+// CHECK: crc32l 3133065982, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0d,0xfe,0xca,0xbe,0xba]
+ crc32l 0xbabecafe,%ecx
+
+// CHECK: crc32l %ecx, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc9]
+ crc32l %ecx,%ecx
diff --git a/test/MC/AsmParser/X86/x86_64-encoding.s b/test/MC/AsmParser/X86/x86_64-encoding.s
new file mode 100644
index 0000000..3920c5b
--- /dev/null
+++ b/test/MC/AsmParser/X86/x86_64-encoding.s
@@ -0,0 +1,73 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
+
+// CHECK: crc32b %bl, %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0xc3]
+ crc32b %bl, %eax
+
+// CHECK: crc32b 4(%rbx), %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
+ crc32b 4(%rbx), %eax
+
+// CHECK: crc32w %bx, %eax
+// CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0xc3]
+ crc32w %bx, %eax
+
+// CHECK: crc32w 4(%rbx), %eax
+// CHECK: encoding: [0x66,0xf2,0x0f,0x38,0xf1,0x43,0x04]
+ crc32w 4(%rbx), %eax
+
+// CHECK: crc32l %ebx, %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc3]
+ crc32l %ebx, %eax
+
+// CHECK: crc32l 4(%rbx), %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x43,0x04]
+ crc32l 4(%rbx), %eax
+
+// CHECK: crc32l 3735928559(%rbx,%rcx,8), %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x8c,0xcb,0xef,0xbe,0xad,0xde]
+ crc32l 0xdeadbeef(%rbx,%rcx,8),%ecx
+
+// CHECK: crc32l 69, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0x45,0x00,0x00,0x00]
+ crc32l 0x45,%ecx
+
+// CHECK: crc32l 32493, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xed,0x7e,0x00,0x00]
+ crc32l 0x7eed,%ecx
+
+// CHECK: crc32l 3133065982, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0x0c,0x25,0xfe,0xca,0xbe,0xba]
+ crc32l 0xbabecafe,%ecx
+
+// CHECK: crc32l %ecx, %ecx
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf1,0xc9]
+ crc32l %ecx,%ecx
+
+// CHECK: crc32b %r11b, %eax
+// CHECK: encoding: [0xf2,0x41,0x0f,0x38,0xf0,0xc3]
+ crc32b %r11b, %eax
+
+// CHECK: crc32b 4(%rbx), %eax
+// CHECK: encoding: [0xf2,0x0f,0x38,0xf0,0x43,0x04]
+ crc32b 4(%rbx), %eax
+
+// CHECK: crc32b %dil, %rax
+// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0xc7]
+ crc32b %dil,%rax
+
+// CHECK: crc32b %r11b, %rax
+// CHECK: encoding: [0xf2,0x49,0x0f,0x38,0xf0,0xc3]
+ crc32b %r11b,%rax
+
+// CHECK: crc32b 4(%rbx), %rax
+// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf0,0x43,0x04]
+ crc32b 4(%rbx), %rax
+
+// CHECK: crc32q %rbx, %rax
+// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0xc3]
+ crc32q %rbx, %rax
+
+// CHECK: crc32q 4(%rbx), %rax
+// CHECK: encoding: [0xf2,0x48,0x0f,0x38,0xf1,0x43,0x04]
+ crc32q 4(%rbx), %rax
diff --git a/test/MC/AsmParser/X86/x86_64-incl_decl.s b/test/MC/AsmParser/X86/x86_64-incl_decl.s
new file mode 100644
index 0000000..51315f8
--- /dev/null
+++ b/test/MC/AsmParser/X86/x86_64-incl_decl.s
@@ -0,0 +1,26 @@
+// RUN: llvm-mc -triple i386-unknown-unknown --show-encoding %s | FileCheck --check-prefix=CHECK-X86_32 %s
+// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck --check-prefix=CHECK-X86_64 %s
+
+# CHECK-X86_32: incb %al # encoding: [0xfe,0xc0]
+# CHECK-X86_64: incb %al # encoding: [0xfe,0xc0]
+ incb %al
+
+# CHECK-X86_32: incw %ax # encoding: [0x66,0x40]
+# CHECK-X86_64: incw %ax # encoding: [0x66,0xff,0xc0]
+ incw %ax
+
+# CHECK-X86_32: incl %eax # encoding: [0x40]
+# CHECK-X86_64: incl %eax # encoding: [0xff,0xc0]
+ incl %eax
+
+# CHECK-X86_32: decb %al # encoding: [0xfe,0xc8]
+# CHECK-X86_64: decb %al # encoding: [0xfe,0xc8]
+ decb %al
+
+# CHECK-X86_32: decw %ax # encoding: [0x66,0x48]
+# CHECK-X86_64: decw %ax # encoding: [0x66,0xff,0xc8]
+ decw %ax
+
+# CHECK-X86_32: decl %eax # encoding: [0x48]
+# CHECK-X86_64: decl %eax # encoding: [0xff,0xc8]
+ decl %eax
diff --git a/test/MC/AsmParser/X86/x86_64-new-encoder.s b/test/MC/AsmParser/X86/x86_64-new-encoder.s
index 797558a..4028bee 100644
--- a/test/MC/AsmParser/X86/x86_64-new-encoder.s
+++ b/test/MC/AsmParser/X86/x86_64-new-encoder.s
@@ -25,5 +25,30 @@ movq $12, foo(%rip)
// CHECK: encoding: [0x48,0xc7,0x05,A,A,A,A,0x0c,0x00,0x00,0x00]
// CHECK: fixup A - offset: 3, value: foo-8, kind: reloc_riprel_4byte
-// CHECK: addq $-424, %rax # encoding: [0x48,0x05,0x58,0xfe,0xff,0xff]
+// CHECK: addq $-424, %rax
+// CHECK: encoding: [0x48,0x05,0x58,0xfe,0xff,0xff]
addq $-424, %rax
+
+
+// CHECK: movq _foo@GOTPCREL(%rip), %rax
+// CHECK: encoding: [0x48,0x8b,0x05,A,A,A,A]
+// CHECK: fixup A - offset: 3, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
+movq _foo@GOTPCREL(%rip), %rax
+
+// CHECK: movq _foo@GOTPCREL(%rip), %r14
+// CHECK: encoding: [0x4c,0x8b,0x35,A,A,A,A]
+// CHECK: fixup A - offset: 3, value: _foo@GOTPCREL-4, kind: reloc_riprel_4byte_movq_load
+movq _foo@GOTPCREL(%rip), %r14
+
+
+// CHECK: movq (%r13,%rax,8), %r13
+// CHECK: encoding: [0x4d,0x8b,0x6c,0xc5,0x00]
+movq 0x00(%r13,%rax,8),%r13
+
+// CHECK: testq %rax, %rbx
+// CHECK: encoding: [0x48,0x85,0xd8]
+testq %rax, %rbx
+
+// CHECK: cmpq %rbx, %r14
+// CHECK: encoding: [0x49,0x39,0xde]
+ cmpq %rbx, %r14
diff --git a/test/MC/MachO/Darwin/dg.exp b/test/MC/MachO/Darwin/dg.exp
deleted file mode 100644
index 0f34b63..0000000
--- a/test/MC/MachO/Darwin/dg.exp
+++ /dev/null
@@ -1,5 +0,0 @@
-load_lib llvm.exp
-
-if { [llvm_supports_darwin_and_target X86] } {
- RunLLVMTests [lsort [glob -nocomplain $srcdir/$subdir/*.{s}]]
-}
diff --git a/test/MC/MachO/Darwin/x86_32_diff_as.s b/test/MC/MachO/Darwin/x86_32_diff_as.s
deleted file mode 100644
index 7fe75aa..0000000
--- a/test/MC/MachO/Darwin/x86_32_diff_as.s
+++ /dev/null
@@ -1,551 +0,0 @@
-// Validate that we can assemble this file exactly like the platform
-// assembler.
-//
-// XFAIL: *
-// RUN: llvm-mc -filetype=obj -triple i386-unknown-unknown -o %t.mc.o %s
-// RUN: as -arch i386 -o %t.as.o %s
-// RUN: diff %t.mc.o %t.as.o
-
- movb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- movw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- movl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- movl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- movsbl 0xdeadbeef(%ebx,%ecx,8),%ecx
- movswl 0xdeadbeef(%ebx,%ecx,8),%ecx
- movzbl 0xdeadbeef(%ebx,%ecx,8),%ecx
- movzwl 0xdeadbeef(%ebx,%ecx,8),%ecx
- pushl 0xdeadbeef(%ebx,%ecx,8)
- popl 0xdeadbeef(%ebx,%ecx,8)
- lahf
- sahf
- addb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- addb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- addw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- addl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- addl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- incl 0xdeadbeef(%ebx,%ecx,8)
- subb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- subb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- subw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- subl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- subl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- decl 0xdeadbeef(%ebx,%ecx,8)
- sbbw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- sbbl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- sbbl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- cmpb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- cmpb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- cmpw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- cmpl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- cmpl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- testb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- testw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- testl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- testl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- andb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- andb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- andw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- andl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- andl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- orb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- orb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- orw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- orl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- orl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- xorb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- xorb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- xorw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- xorl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- xorl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- adcb $0xfe,0xdeadbeef(%ebx,%ecx,8)
- adcb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- adcw $0x7ace,0xdeadbeef(%ebx,%ecx,8)
- adcl $0x7afebabe,0xdeadbeef(%ebx,%ecx,8)
- adcl $0x13572468,0xdeadbeef(%ebx,%ecx,8)
- negl 0xdeadbeef(%ebx,%ecx,8)
- notl 0xdeadbeef(%ebx,%ecx,8)
- cbtw
- cwtl
- cwtd
- cltd
- mull 0xdeadbeef(%ebx,%ecx,8)
- imull 0xdeadbeef(%ebx,%ecx,8)
- divl 0xdeadbeef(%ebx,%ecx,8)
- idivl 0xdeadbeef(%ebx,%ecx,8)
- roll $0,0xdeadbeef(%ebx,%ecx,8)
- rolb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- roll 0xdeadbeef(%ebx,%ecx,8)
- rorl $0,0xdeadbeef(%ebx,%ecx,8)
- rorb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- rorl 0xdeadbeef(%ebx,%ecx,8)
- shll $0,0xdeadbeef(%ebx,%ecx,8)
- shlb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- shll 0xdeadbeef(%ebx,%ecx,8)
- shrl $0,0xdeadbeef(%ebx,%ecx,8)
- shrb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- shrl 0xdeadbeef(%ebx,%ecx,8)
- sarl $0,0xdeadbeef(%ebx,%ecx,8)
- sarb $0x7f,0xdeadbeef(%ebx,%ecx,8)
- sarl 0xdeadbeef(%ebx,%ecx,8)
- call *%ecx
- call *0xdeadbeef(%ebx,%ecx,8)
- call *0xdeadbeef(%ebx,%ecx,8)
- jmp *0xdeadbeef(%ebx,%ecx,8)
- jmp *0xdeadbeef(%ebx,%ecx,8)
- ljmpl *0xdeadbeef(%ebx,%ecx,8)
- lret
- leave
- seto %bl
- seto 0xdeadbeef(%ebx,%ecx,8)
- setno %bl
- setno 0xdeadbeef(%ebx,%ecx,8)
- setb %bl
- setb 0xdeadbeef(%ebx,%ecx,8)
- setae %bl
- setae 0xdeadbeef(%ebx,%ecx,8)
- sete %bl
- sete 0xdeadbeef(%ebx,%ecx,8)
- setne %bl
- setne 0xdeadbeef(%ebx,%ecx,8)
- setbe %bl
- setbe 0xdeadbeef(%ebx,%ecx,8)
- seta %bl
- seta 0xdeadbeef(%ebx,%ecx,8)
- sets %bl
- sets 0xdeadbeef(%ebx,%ecx,8)
- setns %bl
- setns 0xdeadbeef(%ebx,%ecx,8)
- setp %bl
- setp 0xdeadbeef(%ebx,%ecx,8)
- setnp %bl
- setnp 0xdeadbeef(%ebx,%ecx,8)
- setl %bl
- setl 0xdeadbeef(%ebx,%ecx,8)
- setge %bl
- setge 0xdeadbeef(%ebx,%ecx,8)
- setle %bl
- setle 0xdeadbeef(%ebx,%ecx,8)
- setg %bl
- setg 0xdeadbeef(%ebx,%ecx,8)
- nopl 0xdeadbeef(%ebx,%ecx,8)
- nop
- fldl 0xdeadbeef(%ebx,%ecx,8)
- fildl 0xdeadbeef(%ebx,%ecx,8)
- fildll 0xdeadbeef(%ebx,%ecx,8)
- fldt 0xdeadbeef(%ebx,%ecx,8)
- fbld 0xdeadbeef(%ebx,%ecx,8)
- fstl 0xdeadbeef(%ebx,%ecx,8)
- fistl 0xdeadbeef(%ebx,%ecx,8)
- fstpl 0xdeadbeef(%ebx,%ecx,8)
- fistpl 0xdeadbeef(%ebx,%ecx,8)
- fistpll 0xdeadbeef(%ebx,%ecx,8)
- fstpt 0xdeadbeef(%ebx,%ecx,8)
- fbstp 0xdeadbeef(%ebx,%ecx,8)
- ficoml 0xdeadbeef(%ebx,%ecx,8)
- ficompl 0xdeadbeef(%ebx,%ecx,8)
- fucompp
- ftst
- fld1
- fldz
- faddl 0xdeadbeef(%ebx,%ecx,8)
- fiaddl 0xdeadbeef(%ebx,%ecx,8)
- fsubl 0xdeadbeef(%ebx,%ecx,8)
- fisubl 0xdeadbeef(%ebx,%ecx,8)
- fsubrl 0xdeadbeef(%ebx,%ecx,8)
- fisubrl 0xdeadbeef(%ebx,%ecx,8)
- fmull 0xdeadbeef(%ebx,%ecx,8)
- fimull 0xdeadbeef(%ebx,%ecx,8)
- fdivl 0xdeadbeef(%ebx,%ecx,8)
- fidivl 0xdeadbeef(%ebx,%ecx,8)
- fdivrl 0xdeadbeef(%ebx,%ecx,8)
- fidivrl 0xdeadbeef(%ebx,%ecx,8)
- fsqrt
- fsin
- fcos
- fchs
- fabs
- fldcw 0xdeadbeef(%ebx,%ecx,8)
- fnstcw 0xdeadbeef(%ebx,%ecx,8)
- rdtsc
- sysenter
- sysexit
- ud2
- movnti %ecx,0xdeadbeef(%ebx,%ecx,8)
- clflush 0xdeadbeef(%ebx,%ecx,8)
- emms
- movd %ecx,%mm3
- movd 0xdeadbeef(%ebx,%ecx,8),%mm3
- movd %ecx,%xmm5
- movd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movd %xmm5,%ecx
- movd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movq 0xdeadbeef(%ebx,%ecx,8),%mm3
- movq %mm3,%mm3
- movq %mm3,%mm3
- movq %xmm5,%xmm5
- movq %xmm5,%xmm5
- packssdw %mm3,%mm3
- packssdw %xmm5,%xmm5
- packsswb %mm3,%mm3
- packsswb %xmm5,%xmm5
- packuswb %mm3,%mm3
- packuswb %xmm5,%xmm5
- paddb %mm3,%mm3
- paddb %xmm5,%xmm5
- paddw %mm3,%mm3
- paddw %xmm5,%xmm5
- paddd %mm3,%mm3
- paddd %xmm5,%xmm5
- paddq %mm3,%mm3
- paddq %xmm5,%xmm5
- paddsb %mm3,%mm3
- paddsb %xmm5,%xmm5
- paddsw %mm3,%mm3
- paddsw %xmm5,%xmm5
- paddusb %mm3,%mm3
- paddusb %xmm5,%xmm5
- paddusw %mm3,%mm3
- paddusw %xmm5,%xmm5
- pand %mm3,%mm3
- pand %xmm5,%xmm5
- pandn %mm3,%mm3
- pandn %xmm5,%xmm5
- pcmpeqb %mm3,%mm3
- pcmpeqb %xmm5,%xmm5
- pcmpeqw %mm3,%mm3
- pcmpeqw %xmm5,%xmm5
- pcmpeqd %mm3,%mm3
- pcmpeqd %xmm5,%xmm5
- pcmpgtb %mm3,%mm3
- pcmpgtb %xmm5,%xmm5
- pcmpgtw %mm3,%mm3
- pcmpgtw %xmm5,%xmm5
- pcmpgtd %mm3,%mm3
- pcmpgtd %xmm5,%xmm5
- pmaddwd %mm3,%mm3
- pmaddwd %xmm5,%xmm5
- pmulhw %mm3,%mm3
- pmulhw %xmm5,%xmm5
- pmullw %mm3,%mm3
- pmullw %xmm5,%xmm5
- por %mm3,%mm3
- por %xmm5,%xmm5
- psllw %mm3,%mm3
- psllw %xmm5,%xmm5
- psllw $0x7f,%mm3
- psllw $0x7f,%xmm5
- pslld %mm3,%mm3
- pslld %xmm5,%xmm5
- pslld $0x7f,%mm3
- pslld $0x7f,%xmm5
- psllq %mm3,%mm3
- psllq %xmm5,%xmm5
- psllq $0x7f,%mm3
- psllq $0x7f,%xmm5
- psraw %mm3,%mm3
- psraw %xmm5,%xmm5
- psraw $0x7f,%mm3
- psraw $0x7f,%xmm5
- psrad %mm3,%mm3
- psrad %xmm5,%xmm5
- psrad $0x7f,%mm3
- psrad $0x7f,%xmm5
- psrlw %mm3,%mm3
- psrlw %xmm5,%xmm5
- psrlw $0x7f,%mm3
- psrlw $0x7f,%xmm5
- psrld %mm3,%mm3
- psrld %xmm5,%xmm5
- psrld $0x7f,%mm3
- psrld $0x7f,%xmm5
- psrlq %mm3,%mm3
- psrlq %xmm5,%xmm5
- psrlq $0x7f,%mm3
- psrlq $0x7f,%xmm5
- psubb %mm3,%mm3
- psubb %xmm5,%xmm5
- psubw %mm3,%mm3
- psubw %xmm5,%xmm5
- psubd %mm3,%mm3
- psubd %xmm5,%xmm5
- psubq %mm3,%mm3
- psubq %xmm5,%xmm5
- psubsb %mm3,%mm3
- psubsb %xmm5,%xmm5
- psubsw %mm3,%mm3
- psubsw %xmm5,%xmm5
- psubusb %mm3,%mm3
- psubusb %xmm5,%xmm5
- psubusw %mm3,%mm3
- psubusw %xmm5,%xmm5
- punpckhbw %mm3,%mm3
- punpckhbw %xmm5,%xmm5
- punpckhwd %mm3,%mm3
- punpckhwd %xmm5,%xmm5
- punpckhdq %mm3,%mm3
- punpckhdq %xmm5,%xmm5
- punpcklbw %mm3,%mm3
- punpcklbw %xmm5,%xmm5
- punpcklwd %mm3,%mm3
- punpcklwd %xmm5,%xmm5
- punpckldq %mm3,%mm3
- punpckldq %xmm5,%xmm5
- pxor %mm3,%mm3
- pxor %xmm5,%xmm5
- addps %xmm5,%xmm5
- addss %xmm5,%xmm5
- andnps %xmm5,%xmm5
- andps %xmm5,%xmm5
- cvtpi2ps 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtpi2ps %mm3,%xmm5
- cvtps2pi 0xdeadbeef(%ebx,%ecx,8),%mm3
- cvtps2pi %xmm5,%mm3
- cvtsi2ss %ecx,%xmm5
- cvtsi2ss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvttps2pi 0xdeadbeef(%ebx,%ecx,8),%mm3
- cvttps2pi %xmm5,%mm3
- cvttss2si 0xdeadbeef(%ebx,%ecx,8),%ecx
- cvttss2si %xmm5,%ecx
- divps %xmm5,%xmm5
- divss %xmm5,%xmm5
- ldmxcsr 0xdeadbeef(%ebx,%ecx,8)
- maskmovq %mm3,%mm3
- maxps %xmm5,%xmm5
- maxss %xmm5,%xmm5
- minps %xmm5,%xmm5
- minss %xmm5,%xmm5
- movaps 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movaps %xmm5,%xmm5
- movaps %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movaps %xmm5,%xmm5
- movhlps %xmm5,%xmm5
- movhps %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movlhps %xmm5,%xmm5
- movlps %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movmskps %xmm5,%ecx
- movntps %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movntq %mm3,0xdeadbeef(%ebx,%ecx,8)
- movntdq %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movss %xmm5,%xmm5
- movss %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movss %xmm5,%xmm5
- movups 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movups %xmm5,%xmm5
- movups %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movups %xmm5,%xmm5
- mulps %xmm5,%xmm5
- mulss %xmm5,%xmm5
- orps %xmm5,%xmm5
- pavgb %mm3,%mm3
- pavgb %xmm5,%xmm5
- pavgw %mm3,%mm3
- pavgw %xmm5,%xmm5
- pmaxsw %mm3,%mm3
- pmaxsw %xmm5,%xmm5
- pmaxub %mm3,%mm3
- pmaxub %xmm5,%xmm5
- pminsw %mm3,%mm3
- pminsw %xmm5,%xmm5
- pminub %mm3,%mm3
- pminub %xmm5,%xmm5
- pmovmskb %mm3,%ecx
- pmovmskb %xmm5,%ecx
- pmulhuw %mm3,%mm3
- pmulhuw %xmm5,%xmm5
- prefetchnta 0xdeadbeef(%ebx,%ecx,8)
- prefetcht0 0xdeadbeef(%ebx,%ecx,8)
- prefetcht1 0xdeadbeef(%ebx,%ecx,8)
- prefetcht2 0xdeadbeef(%ebx,%ecx,8)
- psadbw %mm3,%mm3
- psadbw %xmm5,%xmm5
- rcpps 0xdeadbeef(%ebx,%ecx,8),%xmm5
- rcpps %xmm5,%xmm5
- rcpss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- rcpss %xmm5,%xmm5
- rsqrtps 0xdeadbeef(%ebx,%ecx,8),%xmm5
- rsqrtps %xmm5,%xmm5
- rsqrtss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- rsqrtss %xmm5,%xmm5
- sqrtps 0xdeadbeef(%ebx,%ecx,8),%xmm5
- sqrtps %xmm5,%xmm5
- sqrtss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- sqrtss %xmm5,%xmm5
- stmxcsr 0xdeadbeef(%ebx,%ecx,8)
- subps %xmm5,%xmm5
- subss %xmm5,%xmm5
- ucomiss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- ucomiss %xmm5,%xmm5
- unpckhps %xmm5,%xmm5
- unpcklps %xmm5,%xmm5
- xorps %xmm5,%xmm5
- addpd %xmm5,%xmm5
- addsd %xmm5,%xmm5
- andnpd %xmm5,%xmm5
- andpd %xmm5,%xmm5
- comisd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- comisd %xmm5,%xmm5
- cvtpi2pd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtpi2pd %mm3,%xmm5
- cvtsi2sd %ecx,%xmm5
- cvtsi2sd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- divpd %xmm5,%xmm5
- divsd %xmm5,%xmm5
- maxpd %xmm5,%xmm5
- maxsd %xmm5,%xmm5
- minpd %xmm5,%xmm5
- minsd %xmm5,%xmm5
- movapd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movapd %xmm5,%xmm5
- movapd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movapd %xmm5,%xmm5
- movhpd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movlpd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movmskpd %xmm5,%ecx
- movntpd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movsd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movsd %xmm5,%xmm5
- movsd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movsd %xmm5,%xmm5
- movupd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movupd %xmm5,%xmm5
- movupd %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movupd %xmm5,%xmm5
- mulpd %xmm5,%xmm5
- mulsd %xmm5,%xmm5
- orpd %xmm5,%xmm5
- sqrtpd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- sqrtpd %xmm5,%xmm5
- sqrtsd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- sqrtsd %xmm5,%xmm5
- subpd %xmm5,%xmm5
- subsd %xmm5,%xmm5
- ucomisd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- ucomisd %xmm5,%xmm5
- unpckhpd %xmm5,%xmm5
- unpcklpd %xmm5,%xmm5
- xorpd %xmm5,%xmm5
- cvtdq2pd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtdq2pd %xmm5,%xmm5
- cvtpd2dq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtpd2dq %xmm5,%xmm5
- cvtdq2ps 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtdq2ps %xmm5,%xmm5
- cvtpd2pi 0xdeadbeef(%ebx,%ecx,8),%mm3
- cvtpd2pi %xmm5,%mm3
- cvtps2dq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtps2dq %xmm5,%xmm5
- cvtsd2ss 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtsd2ss %xmm5,%xmm5
- cvtss2sd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- cvtss2sd %xmm5,%xmm5
- cvttpd2pi 0xdeadbeef(%ebx,%ecx,8),%mm3
- cvttpd2pi %xmm5,%mm3
- cvttsd2si 0xdeadbeef(%ebx,%ecx,8),%ecx
- cvttsd2si %xmm5,%ecx
- maskmovdqu %xmm5,%xmm5
- movdqa 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movdqa %xmm5,%xmm5
- movdqa %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movdqa %xmm5,%xmm5
- movdqu 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movdqu %xmm5,0xdeadbeef(%ebx,%ecx,8)
- movdq2q %xmm5,%mm3
- movq2dq %mm3,%xmm5
- pmuludq %mm3,%mm3
- pmuludq %xmm5,%xmm5
- pslldq $0x7f,%xmm5
- psrldq $0x7f,%xmm5
- punpckhqdq %xmm5,%xmm5
- punpcklqdq %xmm5,%xmm5
- addsubpd %xmm5,%xmm5
- addsubps %xmm5,%xmm5
- haddpd %xmm5,%xmm5
- haddps %xmm5,%xmm5
- hsubpd %xmm5,%xmm5
- hsubps %xmm5,%xmm5
- lddqu 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movddup 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movddup %xmm5,%xmm5
- movshdup 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movshdup %xmm5,%xmm5
- movsldup 0xdeadbeef(%ebx,%ecx,8),%xmm5
- movsldup %xmm5,%xmm5
- phaddw %mm3,%mm3
- phaddw %xmm5,%xmm5
- phaddd %mm3,%mm3
- phaddd %xmm5,%xmm5
- phaddsw %mm3,%mm3
- phaddsw %xmm5,%xmm5
- phsubw %mm3,%mm3
- phsubw %xmm5,%xmm5
- phsubd %mm3,%mm3
- phsubd %xmm5,%xmm5
- phsubsw %mm3,%mm3
- phsubsw %xmm5,%xmm5
- pmaddubsw %mm3,%mm3
- pmaddubsw %xmm5,%xmm5
- pmulhrsw %mm3,%mm3
- pmulhrsw %xmm5,%xmm5
- pshufb %mm3,%mm3
- pshufb %xmm5,%xmm5
- psignb %mm3,%mm3
- psignb %xmm5,%xmm5
- psignw %mm3,%mm3
- psignw %xmm5,%xmm5
- psignd %mm3,%mm3
- psignd %xmm5,%xmm5
- pabsb 0xdeadbeef(%ebx,%ecx,8),%mm3
- pabsb %mm3,%mm3
- pabsb 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pabsb %xmm5,%xmm5
- pabsw 0xdeadbeef(%ebx,%ecx,8),%mm3
- pabsw %mm3,%mm3
- pabsw 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pabsw %xmm5,%xmm5
- pabsd 0xdeadbeef(%ebx,%ecx,8),%mm3
- pabsd %mm3,%mm3
- pabsd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pabsd %xmm5,%xmm5
- femms
- packusdw %xmm5,%xmm5
- pcmpeqq %xmm5,%xmm5
- phminposuw 0xdeadbeef(%ebx,%ecx,8),%xmm5
- phminposuw %xmm5,%xmm5
- pmaxsb %xmm5,%xmm5
- pmaxsd %xmm5,%xmm5
- pmaxud %xmm5,%xmm5
- pmaxuw %xmm5,%xmm5
- pminsb %xmm5,%xmm5
- pminsd %xmm5,%xmm5
- pminud %xmm5,%xmm5
- pminuw %xmm5,%xmm5
- pmovsxbw 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovsxbw %xmm5,%xmm5
- pmovsxbd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovsxbd %xmm5,%xmm5
- pmovsxbq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovsxbq %xmm5,%xmm5
- pmovsxwd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovsxwd %xmm5,%xmm5
- pmovsxwq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovsxwq %xmm5,%xmm5
- pmovsxdq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovsxdq %xmm5,%xmm5
- pmovzxbw 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovzxbw %xmm5,%xmm5
- pmovzxbd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovzxbd %xmm5,%xmm5
- pmovzxbq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovzxbq %xmm5,%xmm5
- pmovzxwd 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovzxwd %xmm5,%xmm5
- pmovzxwq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovzxwq %xmm5,%xmm5
- pmovzxdq 0xdeadbeef(%ebx,%ecx,8),%xmm5
- pmovzxdq %xmm5,%xmm5
- pmuldq %xmm5,%xmm5
- pmulld %xmm5,%xmm5
- ptest 0xdeadbeef(%ebx,%ecx,8),%xmm5
- ptest %xmm5,%xmm5
- pcmpgtq %xmm5,%xmm5
diff --git a/test/MC/MachO/darwin-x86_64-diff-relocs.s b/test/MC/MachO/darwin-x86_64-diff-relocs.s
new file mode 100644
index 0000000..38fa074
--- /dev/null
+++ b/test/MC/MachO/darwin-x86_64-diff-relocs.s
@@ -0,0 +1,329 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+ .text
+
+// FIXME: llvm-mc doesn't handle this in a way we can make compatible with 'as',
+// currently, because of how we handle assembler variables.
+//
+// See <rdar://problem/7763719> improve handling of absolute symbols
+
+// _baz = 4
+
+_foo:
+ xorl %eax,%eax
+_g0:
+ xorl %eax,%eax
+L0:
+ jmp 4
+// jmp _baz
+
+// FIXME: Darwin 'as' for historical reasons widens this jump, but doesn't emit
+// a relocation. It seems like 'as' widens any jump that is not to a temporary,
+// which is inherited from the x86_32 behavior, even though x86_64 could do
+// better.
+// jmp _g0
+
+ jmp L0
+ jmp _g1
+
+// FIXME: Darwin 'as' gets this wrong as well, even though it could get it right
+// given the other things we do on x86_64. It is using a short jump here. This
+// is probably fallout of the hack that exists for x86_32.
+// jmp L1
+
+// FIXME: We don't support this, and would currently get it wrong, it should be a jump to an absolute address.
+// jmp L0 - _g0
+
+// jmp _g1 - _g0
+// FIXME: Darwin 'as' comes up with 'SIGNED' here instead of 'BRANCH'.
+// jmp _g1 - L1
+// FIXME: Darwin 'as' gets this completely wrong. It ends up with a single
+// branch relocation. Fallout from the other delta hack?
+// jmp L1 - _g0
+
+ jmp _g2
+ jmp L2
+ jmp _g3
+ jmp L3
+// FIXME: Darwin 'as' gets this completely wrong. It ends up with a single
+// branch relocation. Fallout from the other delta hack?
+// jmp L2 - _g3
+// jmp _g3 - _g2
+// FIXME: Darwin 'as' comes up with 'SIGNED' here instead of 'BRANCH'.
+// jmp _g3 - L3
+// FIXME: Darwin 'as' gets this completely wrong. It ends up with a single
+// branch relocation. Fallout from the other delta hack?
+// jmp L3 - _g2
+
+ movl %eax,4(%rip)
+// movl %eax,_baz(%rip)
+ movl %eax,_g0(%rip)
+ movl %eax,L0(%rip)
+ movl %eax,_g1(%rip)
+ movl %eax,L1(%rip)
+
+// FIXME: Darwin 'as' gets most of these wrong, and there is an ambiguity in ATT
+// syntax in what they should mean in the first place (absolute or
+// rip-relative address).
+// movl %eax,L0 - _g0(%rip)
+// movl %eax,_g1 - _g0(%rip)
+// movl %eax,_g1 - L1(%rip)
+// movl %eax,L1 - _g0(%rip)
+
+ movl %eax,_g2(%rip)
+ movl %eax,L2(%rip)
+ movl %eax,_g3(%rip)
+ movl %eax,L3(%rip)
+
+// FIXME: Darwin 'as' gets most of these wrong, and there is an ambiguity in ATT
+// syntax in what they should mean in the first place (absolute or
+// rip-relative address).
+// movl %eax,L2 - _g2(%rip)
+// movl %eax,_g3 - _g2(%rip)
+// movl %eax,_g3 - L3(%rip)
+// movl %eax,L3 - _g2(%rip)
+
+_g1:
+ xorl %eax,%eax
+L1:
+ xorl %eax,%eax
+
+ .data
+_g2:
+ xorl %eax,%eax
+L2:
+ .quad 4
+// .quad _baz
+ .quad _g2
+ .quad L2
+ .quad _g3
+ .quad L3
+ .quad L2 - _g2
+ .quad _g3 - _g2
+ .quad L3 - _g2
+ .quad L3 - _g3
+
+ .quad _g0
+ .quad L0
+ .quad _g1
+ .quad L1
+ .quad L0 - _g0
+ .quad _g1 - _g0
+ .quad L1 - _g0
+ .quad L1 - _g1
+
+_g3:
+ xorl %eax,%eax
+L3:
+ xorl %eax,%eax
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 336)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 232)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 236)
+// CHECK: ('file_offset', 368)
+// CHECK: ('file_size', 236)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 94)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 604)
+// CHECK: ('num_reloc', 12)
+// CHECK: ('flags', 0x80000400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+
+// FIXME: Unfortunately, we do not get these relocations in exactly the same
+// order as Darwin 'as'. It turns out that 'as' *usually* ends up emitting
+// them in reverse address order, but sometimes it allocates some
+// additional relocations late so these end up preceed the other entries. I
+// haven't figured out the exact criteria for this yet.
+
+// CHECK: (('word-0', 0x56),
+// CHECK: ('word-1', 0x1d000004)),
+// CHECK: (('word-0', 0x50),
+// CHECK: ('word-1', 0x1d000004)),
+// CHECK: (('word-0', 0x4a),
+// CHECK: ('word-1', 0x1d000003)),
+// CHECK: (('word-0', 0x44),
+// CHECK: ('word-1', 0x1d000003)),
+// CHECK: (('word-0', 0x3e),
+// CHECK: ('word-1', 0x1d000002)),
+// CHECK: (('word-0', 0x38),
+// CHECK: ('word-1', 0x1d000002)),
+// CHECK: (('word-0', 0x20),
+// CHECK: ('word-1', 0x2d000004)),
+// CHECK: (('word-0', 0x1b),
+// CHECK: ('word-1', 0x2d000004)),
+// CHECK: (('word-0', 0x16),
+// CHECK: ('word-1', 0x2d000003)),
+// CHECK: (('word-0', 0x11),
+// CHECK: ('word-1', 0x2d000003)),
+// CHECK: (('word-0', 0xc),
+// CHECK: ('word-1', 0x2d000002)),
+// CHECK: (('word-0', 0x5),
+// CHECK: ('word-1', 0x2d000000)),
+// CHECK: ])
+// CHECK: # Section 1
+// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 94)
+// CHECK: ('size', 142)
+// CHECK: ('offset', 462)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 700)
+// CHECK: ('num_reloc', 16)
+// CHECK: ('flags', 0x400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0x7a),
+// CHECK: ('word-1', 0x5e000001)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0x7a),
+// CHECK: ('word-1', 0xe000002)),
+// CHECK: # Relocation 2
+// CHECK: (('word-0', 0x72),
+// CHECK: ('word-1', 0x5e000001)),
+// CHECK: # Relocation 3
+// CHECK: (('word-0', 0x72),
+// CHECK: ('word-1', 0xe000002)),
+// CHECK: # Relocation 4
+// CHECK: (('word-0', 0x62),
+// CHECK: ('word-1', 0xe000002)),
+// CHECK: # Relocation 5
+// CHECK: (('word-0', 0x5a),
+// CHECK: ('word-1', 0xe000002)),
+// CHECK: # Relocation 6
+// CHECK: (('word-0', 0x52),
+// CHECK: ('word-1', 0xe000001)),
+// CHECK: # Relocation 7
+// CHECK: (('word-0', 0x4a),
+// CHECK: ('word-1', 0xe000001)),
+// CHECK: # Relocation 8
+// CHECK: (('word-0', 0x3a),
+// CHECK: ('word-1', 0x5e000003)),
+// CHECK: # Relocation 9
+// CHECK: (('word-0', 0x3a),
+// CHECK: ('word-1', 0xe000004)),
+// CHECK: # Relocation 10
+// CHECK: (('word-0', 0x32),
+// CHECK: ('word-1', 0x5e000003)),
+// CHECK: # Relocation 11
+// CHECK: (('word-0', 0x32),
+// CHECK: ('word-1', 0xe000004)),
+// CHECK: # Relocation 12
+// CHECK: (('word-0', 0x22),
+// CHECK: ('word-1', 0xe000004)),
+// CHECK: # Relocation 13
+// CHECK: (('word-0', 0x1a),
+// CHECK: ('word-1', 0xe000004)),
+// CHECK: # Relocation 14
+// CHECK: (('word-0', 0x12),
+// CHECK: ('word-1', 0xe000003)),
+// CHECK: # Relocation 15
+// CHECK: (('word-0', 0xa),
+// CHECK: ('word-1', 0xe000003)),
+// CHECK: ])
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 828)
+// CHECK: ('nsyms', 5)
+// CHECK: ('stroff', 908)
+// CHECK: ('strsize', 24)
+// CHECK: ('_string_data', '\x00_foo\x00_g0\x00_g1\x00_g2\x00_g3\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_foo')
+// CHECK: ),
+// CHECK: # Symbol 1
+// CHECK: (('n_strx', 6)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 2)
+// CHECK: ('_string', '_g0')
+// CHECK: ),
+// CHECK: # Symbol 2
+// CHECK: (('n_strx', 10)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 90)
+// CHECK: ('_string', '_g1')
+// CHECK: ),
+// CHECK: # Symbol 3
+// CHECK: (('n_strx', 14)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 94)
+// CHECK: ('_string', '_g2')
+// CHECK: ),
+// CHECK: # Symbol 4
+// CHECK: (('n_strx', 18)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 232)
+// CHECK: ('_string', '_g3')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 5)
+// CHECK: ('iextdefsym', 5)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 5)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
diff --git a/test/MC/MachO/darwin-x86_64-reloc-offsets.s b/test/MC/MachO/darwin-x86_64-reloc-offsets.s
new file mode 100644
index 0000000..ab6820e
--- /dev/null
+++ b/test/MC/MachO/darwin-x86_64-reloc-offsets.s
@@ -0,0 +1,343 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin10 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+ .data
+
+ .org 0x10
+L0:
+ .long 0
+ .long 0
+ .long 0
+ .long 0
+
+_d:
+ .long 0
+L1:
+ .long 0
+
+ .text
+
+// These generate normal x86_64 (external) relocations. They could all use
+// SIGNED, but don't for pedantic compatibility with Darwin 'as'.
+
+ // SIGNED1
+ movb $0x12, _d(%rip)
+
+ // SIGNED
+ movb $0x12, _d + 1(%rip)
+
+ // SIGNED4
+ movl $0x12345678, _d(%rip)
+
+ // SIGNED
+ movl $0x12345678, _d + 1(%rip)
+
+ // SIGNED2
+ movl $0x12345678, _d + 2(%rip)
+
+ // SIGNED1
+ movl $0x12345678, _d + 3(%rip)
+
+ // SIGNED
+ movl $0x12345678, _d + 4(%rip)
+
+ movb %al, _d(%rip)
+ movb %al, _d + 1(%rip)
+ movl %eax, _d(%rip)
+ movl %eax, _d + 1(%rip)
+ movl %eax, _d + 2(%rip)
+ movl %eax, _d + 3(%rip)
+ movl %eax, _d + 4(%rip)
+
+// These have to use local relocations. Since that uses an offset into the
+// section in x86_64 (as opposed to a scattered relocation), and since the
+// linker can only decode this to an atom + offset by scanning the section,
+// it is not possible to correctly encode these without SIGNED<N>. This is
+// ultimately due to a design flaw in the x86_64 relocation format, it is
+// not possible to encode an address (L<foo> + <constant>) which is outside the
+// atom containing L<foo>.
+
+ // SIGNED1
+ movb $0x12, L0(%rip)
+
+ // SIGNED
+ movb $0x12, L0 + 1(%rip)
+
+ // SIGNED4
+ movl $0x12345678, L0(%rip)
+
+ // SIGNED
+ movl $0x12345678, L0 + 1(%rip)
+
+ // SIGNED2
+ movl $0x12345678, L0 + 2(%rip)
+
+ // SIGNED1
+ movl $0x12345678, L0 + 3(%rip)
+
+ // SIGNED
+ movl $0x12345678, L0 + 4(%rip)
+
+ movb %al, L0(%rip)
+ movb %al, L0 + 1(%rip)
+ movl %eax, L0(%rip)
+ movl %eax, L0 + 1(%rip)
+ movl %eax, L0 + 2(%rip)
+ movl %eax, L0 + 3(%rip)
+ movl %eax, L0 + 4(%rip)
+
+ // SIGNED1
+ movb $0x12, L1(%rip)
+
+ // SIGNED
+ movb $0x12, L1 + 1(%rip)
+
+ // SIGNED4
+ movl $0x12345678, L1(%rip)
+
+ // SIGNED
+ movl $0x12345678, L1 + 1(%rip)
+
+ // SIGNED2
+ movl $0x12345678, L1 + 2(%rip)
+
+ // SIGNED1
+ movl $0x12345678, L1 + 3(%rip)
+
+ // SIGNED
+ movl $0x12345678, L1 + 4(%rip)
+
+ movb %al, L1(%rip)
+ movb %al, L1 + 1(%rip)
+ movl %eax, L1(%rip)
+ movl %eax, L1 + 1(%rip)
+ movl %eax, L1 + 2(%rip)
+ movl %eax, L1 + 3(%rip)
+ movl %eax, L1 + 4(%rip)
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 336)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 232)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 358)
+// CHECK: ('file_offset', 368)
+// CHECK: ('file_size', 358)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 2)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 318)
+// CHECK: ('offset', 368)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 728)
+// CHECK: ('num_reloc', 42)
+// CHECK: ('flags', 0x80000400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0x13a),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0x134),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 2
+// CHECK: (('word-0', 0x12e),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 3
+// CHECK: (('word-0', 0x128),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 4
+// CHECK: (('word-0', 0x122),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 5
+// CHECK: (('word-0', 0x11c),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 6
+// CHECK: (('word-0', 0x116),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 7
+// CHECK: (('word-0', 0x10c),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 8
+// CHECK: (('word-0', 0x102),
+// CHECK: ('word-1', 0x6d000000)),
+// CHECK: # Relocation 9
+// CHECK: (('word-0', 0xf8),
+// CHECK: ('word-1', 0x7d000000)),
+// CHECK: # Relocation 10
+// CHECK: (('word-0', 0xee),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 11
+// CHECK: (('word-0', 0xe4),
+// CHECK: ('word-1', 0x8d000000)),
+// CHECK: # Relocation 12
+// CHECK: (('word-0', 0xdd),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 13
+// CHECK: (('word-0', 0xd6),
+// CHECK: ('word-1', 0x6d000000)),
+// CHECK: # Relocation 14
+// CHECK: (('word-0', 0xd0),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 15
+// CHECK: (('word-0', 0xca),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 16
+// CHECK: (('word-0', 0xc4),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 17
+// CHECK: (('word-0', 0xbe),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 18
+// CHECK: (('word-0', 0xb8),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 19
+// CHECK: (('word-0', 0xb2),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 20
+// CHECK: (('word-0', 0xac),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 21
+// CHECK: (('word-0', 0xa2),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 22
+// CHECK: (('word-0', 0x98),
+// CHECK: ('word-1', 0x65000002)),
+// CHECK: # Relocation 23
+// CHECK: (('word-0', 0x8e),
+// CHECK: ('word-1', 0x75000002)),
+// CHECK: # Relocation 24
+// CHECK: (('word-0', 0x84),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 25
+// CHECK: (('word-0', 0x7a),
+// CHECK: ('word-1', 0x85000002)),
+// CHECK: # Relocation 26
+// CHECK: (('word-0', 0x73),
+// CHECK: ('word-1', 0x15000002)),
+// CHECK: # Relocation 27
+// CHECK: (('word-0', 0x6c),
+// CHECK: ('word-1', 0x65000002)),
+// CHECK: # Relocation 28
+// CHECK: (('word-0', 0x66),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 29
+// CHECK: (('word-0', 0x60),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 30
+// CHECK: (('word-0', 0x5a),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 31
+// CHECK: (('word-0', 0x54),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 32
+// CHECK: (('word-0', 0x4e),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 33
+// CHECK: (('word-0', 0x48),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 34
+// CHECK: (('word-0', 0x42),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 35
+// CHECK: (('word-0', 0x38),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 36
+// CHECK: (('word-0', 0x2e),
+// CHECK: ('word-1', 0x6d000000)),
+// CHECK: # Relocation 37
+// CHECK: (('word-0', 0x24),
+// CHECK: ('word-1', 0x7d000000)),
+// CHECK: # Relocation 38
+// CHECK: (('word-0', 0x1a),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 39
+// CHECK: (('word-0', 0x10),
+// CHECK: ('word-1', 0x8d000000)),
+// CHECK: # Relocation 40
+// CHECK: (('word-0', 0x9),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 41
+// CHECK: (('word-0', 0x2),
+// CHECK: ('word-1', 0x6d000000)),
+// CHECK: ])
+// CHECK: ('_section_data', '\xc6\x05\xff\xff\xff\xff\x12\xc6\x05\x00\x00\x00\x00\x12\xc7\x05\xfc\xff\xff\xffxV4\x12\xc7\x05\xfd\xff\xff\xffxV4\x12\xc7\x05\xfe\xff\xff\xffxV4\x12\xc7\x05\xff\xff\xff\xffxV4\x12\xc7\x05\x00\x00\x00\x00xV4\x12\x88\x05\x00\x00\x00\x00\x88\x05\x01\x00\x00\x00\x89\x05\x00\x00\x00\x00\x89\x05\x01\x00\x00\x00\x89\x05\x02\x00\x00\x00\x89\x05\x03\x00\x00\x00\x89\x05\x04\x00\x00\x00\xc6\x05\xdd\x00\x00\x00\x12\xc6\x05\xd7\x00\x00\x00\x12\xc7\x05\xcc\x00\x00\x00xV4\x12\xc7\x05\xc3\x00\x00\x00xV4\x12\xc7\x05\xba\x00\x00\x00xV4\x12\xc7\x05\xb1\x00\x00\x00xV4\x12\xc7\x05\xa8\x00\x00\x00xV4\x12\x88\x05\x9e\x00\x00\x00\x88\x05\x99\x00\x00\x00\x89\x05\x92\x00\x00\x00\x89\x05\x8d\x00\x00\x00\x89\x05\x88\x00\x00\x00\x89\x05\x83\x00\x00\x00\x89\x05~\x00\x00\x00\xc6\x05\x03\x00\x00\x00\x12\xc6\x05\x04\x00\x00\x00\x12\xc7\x05\x00\x00\x00\x00xV4\x12\xc7\x05\x01\x00\x00\x00xV4\x12\xc7\x05\x02\x00\x00\x00xV4\x12\xc7\x05\x03\x00\x00\x00xV4\x12\xc7\x05\x04\x00\x00\x00xV4\x12\x88\x05\x04\x00\x00\x00\x88\x05\x05\x00\x00\x00\x89\x05\x04\x00\x00\x00\x89\x05\x05\x00\x00\x00\x89\x05\x06\x00\x00\x00\x89\x05\x07\x00\x00\x00\x89\x05\x08\x00\x00\x00')
+// CHECK: # Section 1
+// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 318)
+// CHECK: ('size', 40)
+// CHECK: ('offset', 686)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x0)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 1064)
+// CHECK: ('nsyms', 1)
+// CHECK: ('stroff', 1080)
+// CHECK: ('strsize', 4)
+// CHECK: ('_string_data', '\x00_d\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 2)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 350)
+// CHECK: ('_string', '_d')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 1)
+// CHECK: ('iextdefsym', 1)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 1)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
diff --git a/test/MC/MachO/darwin-x86_64-reloc.s b/test/MC/MachO/darwin-x86_64-reloc.s
new file mode 100644
index 0000000..6b325b0
--- /dev/null
+++ b/test/MC/MachO/darwin-x86_64-reloc.s
@@ -0,0 +1,229 @@
+// RUN: llvm-mc -triple x86_64-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
+
+// These examples are taken from <mach-o/x86_64/reloc.h>.
+
+ .text
+_foo:
+ ret
+
+_baz:
+ call _foo
+ call _foo+4
+ movq _foo@GOTPCREL(%rip), %rax
+ pushq _foo@GOTPCREL(%rip)
+ movl _foo(%rip), %eax
+ movl _foo+4(%rip), %eax
+ movb $0x12, _foo(%rip)
+ movl $0x12345678, _foo(%rip)
+ .quad _foo
+_bar:
+ .quad _foo+4
+ .quad _foo - _bar
+ .quad _foo - _bar + 4
+ .long _foo - _bar
+ leaq L1(%rip), %rax
+ leaq L0(%rip), %rax
+ addl $6,L0(%rip)
+ addw $500,L0(%rip)
+ addl $500,L0(%rip)
+
+_prev:
+ .space 12,0x90
+ .quad L1
+L0:
+ .quad L0
+L_pc:
+ .quad _foo - L_pc
+ .quad _foo - L1
+L1:
+ .quad L1 - _prev
+
+// CHECK: ('cputype', 16777223)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 256)
+// CHECK: ('flag', 0)
+// CHECK: ('reserved', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 25)
+// CHECK: ('size', 152)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 181)
+// CHECK: ('file_offset', 288)
+// CHECK: ('file_size', 181)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 1)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 181)
+// CHECK: ('offset', 288)
+// CHECK: ('alignment', 0)
+// CHECK: ('reloc_offset', 472)
+// CHECK: ('num_reloc', 27)
+// CHECK: ('flags', 0x80000400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ('reserved3', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0xa5),
+// CHECK: ('word-1', 0x5e000003)),
+// CHECK: # Relocation 1
+// CHECK: (('word-0', 0xa5),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 2
+// CHECK: (('word-0', 0x9d),
+// CHECK: ('word-1', 0x5e000003)),
+// CHECK: # Relocation 3
+// CHECK: (('word-0', 0x9d),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 4
+// CHECK: (('word-0', 0x95),
+// CHECK: ('word-1', 0xe000003)),
+// CHECK: # Relocation 5
+// CHECK: (('word-0', 0x8d),
+// CHECK: ('word-1', 0xe000003)),
+// CHECK: # Relocation 6
+// CHECK: (('word-0', 0x79),
+// CHECK: ('word-1', 0x8d000003)),
+// CHECK: # Relocation 7
+// CHECK: (('word-0', 0x71),
+// CHECK: ('word-1', 0x7d000003)),
+// CHECK: # Relocation 8
+// CHECK: (('word-0', 0x69),
+// CHECK: ('word-1', 0x6d000003)),
+// CHECK: # Relocation 9
+// CHECK: (('word-0', 0x63),
+// CHECK: ('word-1', 0x1d000003)),
+// CHECK: # Relocation 10
+// CHECK: (('word-0', 0x5c),
+// CHECK: ('word-1', 0x1d000003)),
+// CHECK: # Relocation 11
+// CHECK: (('word-0', 0x55),
+// CHECK: ('word-1', 0x5c000002)),
+// CHECK: # Relocation 12
+// CHECK: (('word-0', 0x55),
+// CHECK: ('word-1', 0xc000000)),
+// CHECK: # Relocation 13
+// CHECK: (('word-0', 0x4d),
+// CHECK: ('word-1', 0x5e000002)),
+// CHECK: # Relocation 14
+// CHECK: (('word-0', 0x4d),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 15
+// CHECK: (('word-0', 0x45),
+// CHECK: ('word-1', 0x5e000002)),
+// CHECK: # Relocation 16
+// CHECK: (('word-0', 0x45),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 17
+// CHECK: (('word-0', 0x3d),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 18
+// CHECK: (('word-0', 0x35),
+// CHECK: ('word-1', 0xe000000)),
+// CHECK: # Relocation 19
+// CHECK: (('word-0', 0x2d),
+// CHECK: ('word-1', 0x8d000000)),
+// CHECK: # Relocation 20
+// CHECK: (('word-0', 0x26),
+// CHECK: ('word-1', 0x6d000000)),
+// CHECK: # Relocation 21
+// CHECK: (('word-0', 0x20),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 22
+// CHECK: (('word-0', 0x1a),
+// CHECK: ('word-1', 0x1d000000)),
+// CHECK: # Relocation 23
+// CHECK: (('word-0', 0x14),
+// CHECK: ('word-1', 0x4d000000)),
+// CHECK: # Relocation 24
+// CHECK: (('word-0', 0xe),
+// CHECK: ('word-1', 0x3d000000)),
+// CHECK: # Relocation 25
+// CHECK: (('word-0', 0x7),
+// CHECK: ('word-1', 0x2d000000)),
+// CHECK: # Relocation 26
+// CHECK: (('word-0', 0x2),
+// CHECK: ('word-1', 0x2d000000)),
+// CHECK: ])
+// CHECK: ('_section_data', '\xc3\xe8\x00\x00\x00\x00\xe8\x04\x00\x00\x00H\x8b\x05\x00\x00\x00\x00\xff5\x00\x00\x00\x00\x8b\x05\x00\x00\x00\x00\x8b\x05\x04\x00\x00\x00\xc6\x05\xff\xff\xff\xff\x12\xc7\x05\xfc\xff\xff\xffxV4\x12\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00H\x8d\x05,\x00\x00\x00H\x8d\x05\x14\x00\x00\x00\x83\x05\x13\x00\x00\x00\x06f\x81\x05\x12\x00\x00\x00\xf4\x01\x81\x05\x10\x00\x00\x00\xf4\x01\x00\x00\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90,\x00\x00\x00\x00\x00\x00\x00\x14\x00\x00\x00\x00\x00\x00\x00\xe4\xff\xff\xff\xff\xff\xff\xff\xd4\xff\xff\xff\xff\xff\xff\xff,\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 1
+// CHECK: (('command', 2)
+// CHECK: ('size', 24)
+// CHECK: ('symoff', 688)
+// CHECK: ('nsyms', 4)
+// CHECK: ('stroff', 752)
+// CHECK: ('strsize', 24)
+// CHECK: ('_string_data', '\x00_foo\x00_baz\x00_bar\x00_prev\x00\x00\x00')
+// CHECK: ('_symbols', [
+// CHECK: # Symbol 0
+// CHECK: (('n_strx', 1)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_foo')
+// CHECK: ),
+// CHECK: # Symbol 1
+// CHECK: (('n_strx', 6)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 1)
+// CHECK: ('_string', '_baz')
+// CHECK: ),
+// CHECK: # Symbol 2
+// CHECK: (('n_strx', 11)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 61)
+// CHECK: ('_string', '_bar')
+// CHECK: ),
+// CHECK: # Symbol 3
+// CHECK: (('n_strx', 16)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 129)
+// CHECK: ('_string', '_prev')
+// CHECK: ),
+// CHECK: ])
+// CHECK: ),
+// CHECK: # Load Command 2
+// CHECK: (('command', 11)
+// CHECK: ('size', 80)
+// CHECK: ('ilocalsym', 0)
+// CHECK: ('nlocalsym', 4)
+// CHECK: ('iextdefsym', 4)
+// CHECK: ('nextdefsym', 0)
+// CHECK: ('iundefsym', 4)
+// CHECK: ('nundefsym', 0)
+// CHECK: ('tocoff', 0)
+// CHECK: ('ntoc', 0)
+// CHECK: ('modtaboff', 0)
+// CHECK: ('nmodtab', 0)
+// CHECK: ('extrefsymoff', 0)
+// CHECK: ('nextrefsyms', 0)
+// CHECK: ('indirectsymoff', 0)
+// CHECK: ('nindirectsyms', 0)
+// CHECK: ('extreloff', 0)
+// CHECK: ('nextrel', 0)
+// CHECK: ('locreloff', 0)
+// CHECK: ('nlocrel', 0)
+// CHECK: ('_indirect_symbols', [
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
diff --git a/test/MC/MachO/reloc.s b/test/MC/MachO/reloc.s
index e86ed8c..c305eeb 100644
--- a/test/MC/MachO/reloc.s
+++ b/test/MC/MachO/reloc.s
@@ -10,7 +10,7 @@ local_a_ext:
local_a:
.long 0
-local_a_elt:
+local_a_elt:
.long 0
local_b:
.long local_b - local_c + 245
@@ -27,9 +27,20 @@ local_c:
.const
.long
-bar:
+bar:
.long local_a_elt - bar + 33
+L0:
+ .long L0
+ .long L1
+
+ .text
+_f0:
+L1:
+ jmp L0
+ jmp L1
+ ret
+
// CHECK: ('cputype', 7)
// CHECK: ('cpusubtype', 3)
// CHECK: ('filetype', 1)
@@ -42,9 +53,9 @@ bar:
// CHECK: ('size', 260)
// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('vm_addr', 0)
-// CHECK: ('vm_size', 47)
+// CHECK: ('vm_size', 63)
// CHECK: ('file_offset', 392)
-// CHECK: ('file_size', 47)
+// CHECK: ('file_size', 63)
// CHECK: ('maxprot', 7)
// CHECK: ('initprot', 7)
// CHECK: ('num_sections', 3)
@@ -54,26 +65,29 @@ bar:
// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('address', 0)
-// CHECK: ('size', 0)
+// CHECK: ('size', 8)
// CHECK: ('offset', 392)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 0)
-// CHECK: ('num_reloc', 0)
-// CHECK: ('flags', 0x80000000)
+// CHECK: ('reloc_offset', 456)
+// CHECK: ('num_reloc', 1)
+// CHECK: ('flags', 0x80000400)
// CHECK: ('reserved1', 0)
// CHECK: ('reserved2', 0)
// CHECK: ),
// CHECK: ('_relocations', [
+// CHECK: # Relocation 0
+// CHECK: (('word-0', 0x1),
+// CHECK: ('word-1', 0x5000003)),
// CHECK: ])
-// CHECK: ('_section_data', '')
+// CHECK: ('_section_data', '\xe92\x00\x00\x00\xeb\xf9\xc3')
// CHECK: # Section 1
// CHECK: (('section_name', '__data\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__DATA\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// CHECK: ('address', 0)
+// CHECK: ('address', 8)
// CHECK: ('size', 43)
-// CHECK: ('offset', 392)
+// CHECK: ('offset', 400)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 440)
+// CHECK: ('reloc_offset', 464)
// CHECK: ('num_reloc', 9)
// CHECK: ('flags', 0x0)
// CHECK: ('reserved1', 0)
@@ -82,72 +96,78 @@ bar:
// CHECK: ('_relocations', [
// CHECK: # Relocation 0
// CHECK: (('word-0', 0x8000002a),
-// CHECK: ('word-1', 0x10)),
+// CHECK: ('word-1', 0x18)),
// CHECK: # Relocation 1
// CHECK: (('word-0', 0x90000028),
-// CHECK: ('word-1', 0x10)),
+// CHECK: ('word-1', 0x18)),
// CHECK: # Relocation 2
// CHECK: (('word-0', 0xa0000024),
-// CHECK: ('word-1', 0x10)),
+// CHECK: ('word-1', 0x18)),
// CHECK: # Relocation 3
// CHECK: (('word-0', 0xa0000020),
-// CHECK: ('word-1', 0x10)),
+// CHECK: ('word-1', 0x18)),
// CHECK: # Relocation 4
// CHECK: (('word-0', 0xa4000014),
-// CHECK: ('word-1', 0x14)),
+// CHECK: ('word-1', 0x1c)),
// CHECK: # Relocation 5
// CHECK: (('word-0', 0xa1000000),
-// CHECK: ('word-1', 0x1c)),
+// CHECK: ('word-1', 0x24)),
// CHECK: # Relocation 6
// CHECK: (('word-0', 0x8),
// CHECK: ('word-1', 0x4000002)),
// CHECK: # Relocation 7
// CHECK: (('word-0', 0x4),
-// CHECK: ('word-1', 0xc000006)),
+// CHECK: ('word-1', 0xc000007)),
// CHECK: # Relocation 8
// CHECK: (('word-0', 0x0),
-// CHECK: ('word-1', 0xc000006)),
+// CHECK: ('word-1', 0xc000007)),
// CHECK: ])
-// CHECK: ('_section_data', '\x00\x00\x00\x00\x04\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00\x1a\x00\x00\x00$\x00i')
+// CHECK: ('_section_data', '\x00\x00\x00\x00\x04\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xed\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x19\x00\x00\x00"\x00\x00\x00,\x00q')
// CHECK: # Section 2
// CHECK: (('section_name', '__const\x00\x00\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
-// CHECK: ('address', 43)
-// CHECK: ('size', 4)
-// CHECK: ('offset', 435)
+// CHECK: ('address', 51)
+// CHECK: ('size', 12)
+// CHECK: ('offset', 443)
// CHECK: ('alignment', 0)
-// CHECK: ('reloc_offset', 512)
-// CHECK: ('num_reloc', 2)
+// CHECK: ('reloc_offset', 536)
+// CHECK: ('num_reloc', 4)
// CHECK: ('flags', 0x0)
// CHECK: ('reserved1', 0)
// CHECK: ('reserved2', 0)
// CHECK: ),
// CHECK: ('_relocations', [
// CHECK: # Relocation 0
-// CHECK: (('word-0', 0xa4000000),
-// CHECK: ('word-1', 0x10)),
+// CHECK: (('word-0', 0x8),
+// CHECK: ('word-1', 0x4000001)),
// CHECK: # Relocation 1
+// CHECK: (('word-0', 0x4),
+// CHECK: ('word-1', 0x4000003)),
+// CHECK: # Relocation 2
+// CHECK: (('word-0', 0xa4000000),
+// CHECK: ('word-1', 0x18)),
+// CHECK: # Relocation 3
// CHECK: (('word-0', 0xa1000000),
-// CHECK: ('word-1', 0x2b)),
+// CHECK: ('word-1', 0x33)),
// CHECK: ])
-// CHECK: ('_section_data', '\x06\x00\x00\x00')
+// CHECK: ('_section_data', '\x06\x00\x00\x007\x00\x00\x00\x00\x00\x00\x00')
// CHECK: ])
// CHECK: ),
// CHECK: # Load Command 1
// CHECK: (('command', 2)
// CHECK: ('size', 24)
-// CHECK: ('symoff', 528)
-// CHECK: ('nsyms', 7)
-// CHECK: ('stroff', 612)
-// CHECK: ('strsize', 60)
-// CHECK: ('_string_data', '\x00undef\x00local_a_ext\x00local_a\x00local_a_elt\x00local_b\x00local_c\x00bar\x00\x00')
+// CHECK: ('symoff', 568)
+// CHECK: ('nsyms', 8)
+// CHECK: ('stroff', 664)
+// CHECK: ('strsize', 64)
+// CHECK: ('_string_data', '\x00undef\x00local_a_ext\x00local_a\x00local_a_elt\x00local_b\x00local_c\x00bar\x00_f0\x00\x00')
// CHECK: ('_symbols', [
// CHECK: # Symbol 0
// CHECK: (('n_strx', 19)
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 12)
+// CHECK: ('n_value', 20)
// CHECK: ('_string', 'local_a')
// CHECK: ),
// CHECK: # Symbol 1
@@ -155,7 +175,7 @@ bar:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 16)
+// CHECK: ('n_value', 24)
// CHECK: ('_string', 'local_a_elt')
// CHECK: ),
// CHECK: # Symbol 2
@@ -163,7 +183,7 @@ bar:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 20)
+// CHECK: ('n_value', 28)
// CHECK: ('_string', 'local_b')
// CHECK: ),
// CHECK: # Symbol 3
@@ -171,7 +191,7 @@ bar:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 28)
+// CHECK: ('n_value', 36)
// CHECK: ('_string', 'local_c')
// CHECK: ),
// CHECK: # Symbol 4
@@ -179,18 +199,26 @@ bar:
// CHECK: ('n_type', 0xe)
// CHECK: ('n_sect', 3)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 43)
+// CHECK: ('n_value', 51)
// CHECK: ('_string', 'bar')
// CHECK: ),
// CHECK: # Symbol 5
+// CHECK: (('n_strx', 59)
+// CHECK: ('n_type', 0xe)
+// CHECK: ('n_sect', 1)
+// CHECK: ('n_desc', 0)
+// CHECK: ('n_value', 0)
+// CHECK: ('_string', '_f0')
+// CHECK: ),
+// CHECK: # Symbol 6
// CHECK: (('n_strx', 7)
// CHECK: ('n_type', 0xf)
// CHECK: ('n_sect', 2)
// CHECK: ('n_desc', 0)
-// CHECK: ('n_value', 8)
+// CHECK: ('n_value', 16)
// CHECK: ('_string', 'local_a_ext')
// CHECK: ),
-// CHECK: # Symbol 6
+// CHECK: # Symbol 7
// CHECK: (('n_strx', 1)
// CHECK: ('n_type', 0x1)
// CHECK: ('n_sect', 0)
@@ -204,10 +232,10 @@ bar:
// CHECK: (('command', 11)
// CHECK: ('size', 80)
// CHECK: ('ilocalsym', 0)
-// CHECK: ('nlocalsym', 5)
-// CHECK: ('iextdefsym', 5)
+// CHECK: ('nlocalsym', 6)
+// CHECK: ('iextdefsym', 6)
// CHECK: ('nextdefsym', 1)
-// CHECK: ('iundefsym', 6)
+// CHECK: ('iundefsym', 7)
// CHECK: ('nundefsym', 1)
// CHECK: ('tocoff', 0)
// CHECK: ('ntoc', 0)
diff --git a/test/MC/MachO/Darwin/optimal_nop.s b/test/MC/MachO/x86_32-optimal_nop.s
index 29cb073..d21d143 100644
--- a/test/MC/MachO/Darwin/optimal_nop.s
+++ b/test/MC/MachO/x86_32-optimal_nop.s
@@ -1,9 +1,4 @@
-// Validate that we can assemble this file exactly like the platform
-// assembler.
-//
-// RUN: llvm-mc -filetype=obj -triple i386-apple-darwin10 -o %t.mc.o %s
-// RUN: as -arch i386 -o %t.as.o %s
-// RUN: diff %t.mc.o %t.as.o
+// RUN: llvm-mc -triple i386-apple-darwin9 %s -filetype=obj -o - | macho-dump --dump-section-data | FileCheck %s
# 1 byte nop test
.align 4, 0 # start with 16 byte alignment filled with zeros
@@ -154,3 +149,43 @@
# 0x0f, 0x1f, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00
.align 4, 0x90
ret
+
+// CHECK: ('cputype', 7)
+// CHECK: ('cpusubtype', 3)
+// CHECK: ('filetype', 1)
+// CHECK: ('num_load_commands', 1)
+// CHECK: ('load_commands_size', 124)
+// CHECK: ('flag', 0)
+// CHECK: ('load_commands', [
+// CHECK: # Load Command 0
+// CHECK: (('command', 1)
+// CHECK: ('size', 124)
+// CHECK: ('segment_name', '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('vm_addr', 0)
+// CHECK: ('vm_size', 337)
+// CHECK: ('file_offset', 152)
+// CHECK: ('file_size', 337)
+// CHECK: ('maxprot', 7)
+// CHECK: ('initprot', 7)
+// CHECK: ('num_sections', 1)
+// CHECK: ('flags', 0)
+// CHECK: ('sections', [
+// CHECK: # Section 0
+// CHECK: (('section_name', '__text\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('segment_name', '__TEXT\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')
+// CHECK: ('address', 0)
+// CHECK: ('size', 337)
+// CHECK: ('offset', 152)
+// CHECK: ('alignment', 4)
+// CHECK: ('reloc_offset', 0)
+// CHECK: ('num_reloc', 0)
+// CHECK: ('flags', 0x80000400)
+// CHECK: ('reserved1', 0)
+// CHECK: ('reserved2', 0)
+// CHECK: ),
+// CHECK: ('_relocations', [
+// CHECK: ])
+// CHECK: ('_section_data', '\xc3\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x90\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\x0f\x1f@\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\xc3\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\xc3\xc3f\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3\xc3\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3\xc3f\x0f\x1fD\x00\x00f\x0f\x1fD\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\xc3f\x0f\x1fD\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x80\x00\x00\x00\x00\xc3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc3\x0f\x1f\x80\x00\x00\x00\x00\x0f\x1f\x84\x00\x00\x00\x00\x00\xc3')
+// CHECK: ])
+// CHECK: ),
+// CHECK: ])
OpenPOWER on IntegriCloud