summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/ARM/2009-10-27-double-align.ll4
-rw-r--r--test/CodeGen/ARM/2009-10-30.ll2
-rw-r--r--test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll13
-rw-r--r--test/CodeGen/ARM/arm-negative-stride.ll2
-rw-r--r--test/CodeGen/ARM/globals.ll4
-rw-r--r--test/CodeGen/ARM/ifcvt5.ll2
-rw-r--r--test/CodeGen/ARM/ifcvt6.ll2
-rw-r--r--test/CodeGen/ARM/ifcvt7.ll2
-rw-r--r--test/CodeGen/ARM/ifcvt8.ll2
-rw-r--r--test/CodeGen/ARM/ldm.ll2
-rw-r--r--test/CodeGen/ARM/ldrd.ll4
-rw-r--r--test/CodeGen/ARM/str_pre-2.ll2
-rw-r--r--test/CodeGen/ARM/tls2.ll4
-rw-r--r--test/CodeGen/Generic/dbg_value.ll13
-rw-r--r--test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll4
-rw-r--r--test/CodeGen/Thumb2/large-stack.ll2
-rw-r--r--test/CodeGen/Thumb2/ldr-str-imm12.ll8
-rw-r--r--test/CodeGen/Thumb2/thumb2-ldr.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-ldrh.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-str.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-str_pre.ll4
-rw-r--r--test/CodeGen/Thumb2/thumb2-strb.ll2
-rw-r--r--test/CodeGen/Thumb2/thumb2-strh.ll2
-rw-r--r--test/CodeGen/X86/2007-01-08-InstrSched.ll16
-rw-r--r--test/CodeGen/X86/2010-03-17-ISelBug.ll39
-rw-r--r--test/CodeGen/X86/gather-addresses.ll1
-rw-r--r--test/CodeGen/X86/lsr-reuse.ll20
-rw-r--r--test/CodeGen/X86/sibcall.ll59
-rw-r--r--test/CodeGen/X86/sse2.ll8
-rw-r--r--test/CodeGen/X86/sse3.ll10
-rw-r--r--test/CodeGen/X86/sse42.ll12
-rw-r--r--test/CodeGen/X86/widen_load-2.ll26
-rw-r--r--test/DebugInfo/2010-03-19-DbgDeclare.ll12
-rw-r--r--test/FrontendObjC/2010-03-17-StructRef.m43
-rw-r--r--test/LLVMC/AppendCmdHook.td1
-rw-r--r--test/LLVMC/C++/dash-x.cpp1
-rw-r--r--test/LLVMC/C++/hello.cpp1
-rw-r--r--test/LLVMC/C++/together.cpp1
-rw-r--r--test/LLVMC/C/emit-llvm.c1
-rw-r--r--test/LLVMC/C/hello.c1
-rw-r--r--test/LLVMC/C/include.c1
-rw-r--r--test/LLVMC/C/opt-test.c1
-rw-r--r--test/LLVMC/C/sink.c1
-rw-r--r--test/LLVMC/C/wall.c1
-rw-r--r--test/LLVMC/EmptyCompilationGraph.td1
-rw-r--r--test/LLVMC/EnvParentheses.td1
-rw-r--r--test/LLVMC/ExternOptions.td1
-rw-r--r--test/LLVMC/ForwardAs.td1
-rw-r--r--test/LLVMC/ForwardTransformedValue.td1
-rw-r--r--test/LLVMC/ForwardValue.td1
-rw-r--r--test/LLVMC/HookWithArguments.td1
-rw-r--r--test/LLVMC/HookWithInFile.td1
-rw-r--r--test/LLVMC/Init.td1
-rw-r--r--test/LLVMC/MultiValuedOption.td1
-rw-r--r--test/LLVMC/MultipleCompilationGraphs.td1
-rw-r--r--test/LLVMC/NoActions.td1
-rw-r--r--test/LLVMC/NoCompilationGraph.td1
-rw-r--r--test/LLVMC/OneOrMore.td1
-rw-r--r--test/LLVMC/OptionPreprocessor.td1
-rw-r--r--test/LLVMC/TestWarnings.td3
-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
-rw-r--r--test/TableGen/2003-08-03-PassCode.td1
-rw-r--r--test/TableGen/2006-09-18-LargeInt.td1
-rw-r--r--test/TableGen/AnonDefinitionOnDemand.td1
-rw-r--r--test/TableGen/DagDefSubst.td1
-rw-r--r--test/TableGen/DagIntSubst.td1
-rw-r--r--test/TableGen/DefmInherit.td1
-rw-r--r--test/TableGen/ForwardRef.td1
-rw-r--r--test/TableGen/GeneralList.td1
-rw-r--r--test/TableGen/IntBitInit.td1
-rw-r--r--test/TableGen/LazyChange.td2
-rw-r--r--test/TableGen/ListArgs.td1
-rw-r--r--test/TableGen/ListArgsSimple.td1
-rw-r--r--test/TableGen/ListConversion.td1
-rw-r--r--test/TableGen/ListSlices.td1
-rw-r--r--test/TableGen/MultiClass.td1
-rw-r--r--test/TableGen/MultiClassDefName.td1
-rw-r--r--test/TableGen/MultiClassInherit.td1
-rw-r--r--test/TableGen/Slice.td1
-rw-r--r--test/TableGen/String.td1
-rw-r--r--test/TableGen/SuperSubclassSameName.td1
-rw-r--r--test/TableGen/TargetInstrInfo.td1
-rw-r--r--test/TableGen/TargetInstrSpec.td1
-rw-r--r--test/TableGen/TemplateArgRename.td1
-rw-r--r--test/TableGen/Tree.td1
-rw-r--r--test/TableGen/TreeNames.td1
-rw-r--r--test/TableGen/UnsetBitInit.td1
-rw-r--r--test/TableGen/cast.td1
-rw-r--r--test/TableGen/eq.td1
-rw-r--r--test/TableGen/foreach.td1
-rw-r--r--test/TableGen/if.td1
-rw-r--r--test/TableGen/lisp.td1
-rw-r--r--test/TableGen/nameconcat.td1
-rw-r--r--test/TableGen/strconcat.td1
-rw-r--r--test/TableGen/subst.td1
-rw-r--r--test/TableGen/subst2.td1
-rw-r--r--test/lit.cfg4
108 files changed, 1538 insertions, 701 deletions
diff --git a/test/CodeGen/ARM/2009-10-27-double-align.ll b/test/CodeGen/ARM/2009-10-27-double-align.ll
index a4e7685..f17d059 100644
--- a/test/CodeGen/ARM/2009-10-27-double-align.ll
+++ b/test/CodeGen/ARM/2009-10-27-double-align.ll
@@ -4,8 +4,8 @@
define arm_aapcscc void @g() {
entry:
-;CHECK: [sp, #+8]
-;CHECK: [sp, #+12]
+;CHECK: [sp, #8]
+;CHECK: [sp, #12]
;CHECK: [sp]
tail call arm_aapcscc void (i8*, ...)* @f(i8* getelementptr ([1 x i8]* @.str, i32 0, i32 0), i32 1, double 2.000000e+00, i32 3, double 4.000000e+00)
ret void
diff --git a/test/CodeGen/ARM/2009-10-30.ll b/test/CodeGen/ARM/2009-10-30.ll
index 90a5bd2..87d1a8b 100644
--- a/test/CodeGen/ARM/2009-10-30.ll
+++ b/test/CodeGen/ARM/2009-10-30.ll
@@ -6,7 +6,7 @@ define void @f(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, ...) {
entry:
;CHECK: sub sp, sp, #4
;CHECK: add r{{[0-9]+}}, sp, #8
-;CHECK: str r{{[0-9]+}}, [sp], #+4
+;CHECK: str r{{[0-9]+}}, [sp], #4
;CHECK: bx lr
%ap = alloca i8*, align 4
%ap1 = bitcast i8** %ap to i8*
diff --git a/test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll b/test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll
new file mode 100644
index 0000000..31525ef
--- /dev/null
+++ b/test/CodeGen/ARM/2010-03-18-ldm-rtrn.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -mtriple=armv4-unknown-eabi | FileCheck %s
+; RUN: llc < %s -mtriple=armv5-unknown-eabi | FileCheck %s
+; RUN: llc < %s -mtriple=armv6-unknown-eabi | FileCheck %s
+
+define i32 @bar(i32 %a) nounwind {
+entry:
+ %0 = tail call i32 @foo(i32 %a) nounwind ; <i32> [#uses=1]
+ %1 = add nsw i32 %0, 3 ; <i32> [#uses=1]
+; CHECK: ldmia sp!, {r11, pc}
+ ret i32 %1
+}
+
+declare i32 @foo(i32)
diff --git a/test/CodeGen/ARM/arm-negative-stride.ll b/test/CodeGen/ARM/arm-negative-stride.ll
index 52ab871..fb0f8ff 100644
--- a/test/CodeGen/ARM/arm-negative-stride.ll
+++ b/test/CodeGen/ARM/arm-negative-stride.ll
@@ -5,7 +5,7 @@
define void @test(i32* %P, i32 %A, i32 %i) nounwind {
entry:
-; CHECK: str r1, [{{r.*}}, +{{r.*}}, lsl #2]
+; CHECK: str r1, [{{r.*}}, {{r.*}}, lsl #2]
icmp eq i32 %i, 0 ; <i1>:0 [#uses=1]
br i1 %0, label %return, label %bb
diff --git a/test/CodeGen/ARM/globals.ll b/test/CodeGen/ARM/globals.ll
index 886c0d5..adb4497 100644
--- a/test/CodeGen/ARM/globals.ll
+++ b/test/CodeGen/ARM/globals.ll
@@ -41,7 +41,7 @@ define i32 @test1() {
; DarwinPIC: _test1:
; DarwinPIC: ldr r0, LCPI1_0
; DarwinPIC: LPC1_0:
-; DarwinPIC: ldr r0, [pc, +r0]
+; DarwinPIC: ldr r0, [pc, r0]
; DarwinPIC: ldr r0, [r0]
; DarwinPIC: bx lr
@@ -63,7 +63,7 @@ define i32 @test1() {
; LinuxPIC: .LPC1_0:
; LinuxPIC: add r0, pc, r0
-; LinuxPIC: ldr r0, [r1, +r0]
+; LinuxPIC: ldr r0, [r1, r0]
; LinuxPIC: ldr r0, [r0]
; LinuxPIC: bx lr
diff --git a/test/CodeGen/ARM/ifcvt5.ll b/test/CodeGen/ARM/ifcvt5.ll
index 623f2cb..8677ce5 100644
--- a/test/CodeGen/ARM/ifcvt5.ll
+++ b/test/CodeGen/ARM/ifcvt5.ll
@@ -11,7 +11,7 @@ entry:
define void @t1(i32 %a, i32 %b) {
; CHECK: t1:
-; CHECK: ldmfdlt sp!, {r7, pc}
+; CHECK: ldmialt sp!, {r7, pc}
entry:
%tmp1 = icmp sgt i32 %a, 10 ; <i1> [#uses=1]
br i1 %tmp1, label %cond_true, label %UnifiedReturnBlock
diff --git a/test/CodeGen/ARM/ifcvt6.ll b/test/CodeGen/ARM/ifcvt6.ll
index d7fcf7d..342208b 100644
--- a/test/CodeGen/ARM/ifcvt6.ll
+++ b/test/CodeGen/ARM/ifcvt6.ll
@@ -1,7 +1,7 @@
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
; RUN: grep cmpne | count 1
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep ldmfdhi | count 1
+; RUN: grep ldmiahi | count 1
define void @foo(i32 %X, i32 %Y) {
entry:
diff --git a/test/CodeGen/ARM/ifcvt7.ll b/test/CodeGen/ARM/ifcvt7.ll
index c60ad93..eb97085 100644
--- a/test/CodeGen/ARM/ifcvt7.ll
+++ b/test/CodeGen/ARM/ifcvt7.ll
@@ -3,7 +3,7 @@
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
; RUN: grep moveq | count 1
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep ldmfdeq | count 1
+; RUN: grep ldmiaeq | count 1
; FIXME: Need post-ifcvt branch folding to get rid of the extra br at end of BB1.
%struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
diff --git a/test/CodeGen/ARM/ifcvt8.ll b/test/CodeGen/ARM/ifcvt8.ll
index a7da834..1e39060 100644
--- a/test/CodeGen/ARM/ifcvt8.ll
+++ b/test/CodeGen/ARM/ifcvt8.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -march=arm -mtriple=arm-apple-darwin | \
-; RUN: grep ldmfdne | count 1
+; RUN: grep ldmiane | count 1
%struct.SString = type { i8*, i32, i32 }
diff --git a/test/CodeGen/ARM/ldm.ll b/test/CodeGen/ARM/ldm.ll
index 1a016a0..9a2dc82 100644
--- a/test/CodeGen/ARM/ldm.ll
+++ b/test/CodeGen/ARM/ldm.ll
@@ -24,7 +24,7 @@ define i32 @t2() {
define i32 @t3() {
; CHECK: t3:
; CHECK: ldmib
-; CHECK: ldmfd sp!
+; CHECK: ldmia sp!
%tmp = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 1) ; <i32> [#uses=1]
%tmp3 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 2) ; <i32> [#uses=1]
%tmp5 = load i32* getelementptr ([0 x i32]* @X, i32 0, i32 3) ; <i32> [#uses=1]
diff --git a/test/CodeGen/ARM/ldrd.ll b/test/CodeGen/ARM/ldrd.ll
index c366e2d..895562a 100644
--- a/test/CodeGen/ARM/ldrd.ll
+++ b/test/CodeGen/ARM/ldrd.ll
@@ -10,10 +10,10 @@ entry:
;V6: ldrd r2, [r2]
;V5: ldr r3, [r2]
-;V5: ldr r2, [r2, #+4]
+;V5: ldr r2, [r2, #4]
;EABI: ldr r3, [r2]
-;EABI: ldr r2, [r2, #+4]
+;EABI: ldr r2, [r2, #4]
%0 = load i64** @b, align 4
%1 = load i64* %0, align 4
diff --git a/test/CodeGen/ARM/str_pre-2.ll b/test/CodeGen/ARM/str_pre-2.ll
index f8d3df2..553cd64 100644
--- a/test/CodeGen/ARM/str_pre-2.ll
+++ b/test/CodeGen/ARM/str_pre-2.ll
@@ -1,5 +1,5 @@
; RUN: llc < %s -mtriple=arm-linux-gnu | grep {str.*\\!}
-; RUN: llc < %s -mtriple=arm-linux-gnu | grep {ldr.*\\\[.*\], #+4}
+; RUN: llc < %s -mtriple=arm-linux-gnu | grep {ldr.*\\\[.*\], #4}
@b = external global i64*
diff --git a/test/CodeGen/ARM/tls2.ll b/test/CodeGen/ARM/tls2.ll
index d932f90..57370c4 100644
--- a/test/CodeGen/ARM/tls2.ll
+++ b/test/CodeGen/ARM/tls2.ll
@@ -7,7 +7,7 @@
define i32 @f() {
; CHECK-NONPIC: f:
-; CHECK-NONPIC: ldr {{r.}}, [pc, +{{r.}}]
+; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
; CHECK-NONPIC: i(gottpoff)
; CHECK-PIC: f:
; CHECK-PIC: __tls_get_addr
@@ -18,7 +18,7 @@ entry:
define i32* @g() {
; CHECK-NONPIC: g:
-; CHECK-NONPIC: ldr {{r.}}, [pc, +{{r.}}]
+; CHECK-NONPIC: ldr {{r.}}, [pc, {{r.}}]
; CHECK-NONPIC: i(gottpoff)
; CHECK-PIC: g:
; CHECK-PIC: __tls_get_addr
diff --git a/test/CodeGen/Generic/dbg_value.ll b/test/CodeGen/Generic/dbg_value.ll
new file mode 100644
index 0000000..ce3364d
--- /dev/null
+++ b/test/CodeGen/Generic/dbg_value.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s
+; rdar://7759395
+
+%0 = type { i32, i32 }
+
+define void @t(%0*, i32, i32, i32, i32) nounwind {
+ tail call void @llvm.dbg.value(metadata !{%0* %0}, i64 0, metadata !0)
+ unreachable
+}
+
+declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
+
+!0 = metadata !{i32 0} ;
diff --git a/test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll b/test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll
index b4b6ed9..bfb7f6e 100644
--- a/test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll
+++ b/test/CodeGen/Thumb2/2009-10-15-ITBlockBranch.ll
@@ -12,10 +12,10 @@
define weak arm_aapcs_vfpcc i32 @_ZNKSs7compareERKSs(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this, %"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %__str) {
; CHECK: _ZNKSs7compareERKSs:
; CHECK: it ne
-; CHECK-NEXT: ldmfdne.w
+; CHECK-NEXT: ldmiane.w
; CHECK-NEXT: itt eq
; CHECK-NEXT: subeq.w
-; CHECK-NEXT: ldmfdeq.w
+; CHECK-NEXT: ldmiaeq.w
entry:
%0 = tail call arm_aapcs_vfpcc i32 @_ZNKSs4sizeEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %this) ; <i32> [#uses=3]
%1 = tail call arm_aapcs_vfpcc i32 @_ZNKSs4sizeEv(%"struct.std::basic_string<char,std::char_traits<char>,std::allocator<char> >"* %__str) ; <i32> [#uses=3]
diff --git a/test/CodeGen/Thumb2/large-stack.ll b/test/CodeGen/Thumb2/large-stack.ll
index fe0e506..9729534 100644
--- a/test/CodeGen/Thumb2/large-stack.ll
+++ b/test/CodeGen/Thumb2/large-stack.ll
@@ -27,7 +27,7 @@ define i32 @test3() {
; DARWIN: sub.w sp, sp, #805306368
; DARWIN: sub sp, #20
; LINUX: test3:
-; LINUX: stmfd sp!, {r4, r7, r11, lr}
+; LINUX: stmdb sp!, {r4, r7, r11, lr}
; LINUX: sub.w sp, sp, #805306368
; LINUX: sub sp, #16
%retval = alloca i32, align 4
diff --git a/test/CodeGen/Thumb2/ldr-str-imm12.ll b/test/CodeGen/Thumb2/ldr-str-imm12.ll
index f007b5c..55cdac9 100644
--- a/test/CodeGen/Thumb2/ldr-str-imm12.ll
+++ b/test/CodeGen/Thumb2/ldr-str-imm12.ll
@@ -22,7 +22,7 @@
define arm_apcscc %union.rec* @Manifest(%union.rec* %x, %union.rec* %env, %struct.STYLE* %style, %union.rec** %bthr, %union.rec** %fthr, %union.rec** %target, %union.rec** %crs, i32 %ok, i32 %need_expand, %union.rec** %enclose, i32 %fcr) nounwind {
entry:
-; CHECK: ldr.w r9, [r7, #+28]
+; CHECK: ldr.w r9, [r7, #28]
%xgaps.i = alloca [32 x %union.rec*], align 4 ; <[32 x %union.rec*]*> [#uses=0]
%ycomp.i = alloca [32 x %union.rec*], align 4 ; <[32 x %union.rec*]*> [#uses=0]
br i1 false, label %bb, label %bb20
@@ -50,9 +50,9 @@ bb119: ; preds = %bb20, %bb20
bb420: ; preds = %bb20, %bb20
; CHECK: bb420
; CHECK: str r{{[0-7]}}, [sp]
-; CHECK: str r{{[0-7]}}, [sp, #+4]
-; CHECK: str r{{[0-7]}}, [sp, #+8]
-; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp, #+24]
+; CHECK: str r{{[0-7]}}, [sp, #4]
+; CHECK: str r{{[0-7]}}, [sp, #8]
+; CHECK: str{{(.w)?}} r{{[0-9]+}}, [sp, #24]
store %union.rec* null, %union.rec** @zz_hold, align 4
store %union.rec* null, %union.rec** @zz_res, align 4
store %union.rec* %x, %union.rec** @zz_hold, align 4
diff --git a/test/CodeGen/Thumb2/thumb2-ldr.ll b/test/CodeGen/Thumb2/thumb2-ldr.ll
index 94888fd..88434f1 100644
--- a/test/CodeGen/Thumb2/thumb2-ldr.ll
+++ b/test/CodeGen/Thumb2/thumb2-ldr.ll
@@ -11,7 +11,7 @@ entry:
define i32 @f2(i32* %v) {
entry:
; CHECK: f2:
-; CHECK: ldr.w r0, [r0, #+4092]
+; CHECK: ldr.w r0, [r0, #4092]
%tmp2 = getelementptr i32* %v, i32 1023
%tmp = load i32* %tmp2
ret i32 %tmp
diff --git a/test/CodeGen/Thumb2/thumb2-ldrh.ll b/test/CodeGen/Thumb2/thumb2-ldrh.ll
index f1fb79c..fee97bf 100644
--- a/test/CodeGen/Thumb2/thumb2-ldrh.ll
+++ b/test/CodeGen/Thumb2/thumb2-ldrh.ll
@@ -11,7 +11,7 @@ entry:
define i16 @f2(i16* %v) {
entry:
; CHECK: f2:
-; CHECK: ldrh.w r0, [r0, #+2046]
+; CHECK: ldrh.w r0, [r0, #2046]
%tmp2 = getelementptr i16* %v, i16 1023
%tmp = load i16* %tmp2
ret i16 %tmp
diff --git a/test/CodeGen/Thumb2/thumb2-str.ll b/test/CodeGen/Thumb2/thumb2-str.ll
index 3eeec8c..11bb936 100644
--- a/test/CodeGen/Thumb2/thumb2-str.ll
+++ b/test/CodeGen/Thumb2/thumb2-str.ll
@@ -9,7 +9,7 @@ define i32 @f1(i32 %a, i32* %v) {
define i32 @f2(i32 %a, i32* %v) {
; CHECK: f2:
-; CHECK: str.w r0, [r1, #+4092]
+; CHECK: str.w r0, [r1, #4092]
%tmp2 = getelementptr i32* %v, i32 1023
store i32 %a, i32* %tmp2
ret i32 %a
diff --git a/test/CodeGen/Thumb2/thumb2-str_pre.ll b/test/CodeGen/Thumb2/thumb2-str_pre.ll
index 9af960b..1e6616a 100644
--- a/test/CodeGen/Thumb2/thumb2-str_pre.ll
+++ b/test/CodeGen/Thumb2/thumb2-str_pre.ll
@@ -2,7 +2,7 @@
define void @test1(i32* %X, i32* %A, i32** %dest) {
; CHECK: test1
-; CHECK: str r1, [r0, #+16]!
+; CHECK: str r1, [r0, #16]!
%B = load i32* %A ; <i32> [#uses=1]
%Y = getelementptr i32* %X, i32 4 ; <i32*> [#uses=2]
store i32 %B, i32* %Y
@@ -12,7 +12,7 @@ define void @test1(i32* %X, i32* %A, i32** %dest) {
define i16* @test2(i16* %X, i32* %A) {
; CHECK: test2
-; CHECK: strh r1, [r0, #+8]!
+; CHECK: strh r1, [r0, #8]!
%B = load i32* %A ; <i32> [#uses=1]
%Y = getelementptr i16* %X, i32 4 ; <i16*> [#uses=2]
%tmp = trunc i32 %B to i16 ; <i16> [#uses=1]
diff --git a/test/CodeGen/Thumb2/thumb2-strb.ll b/test/CodeGen/Thumb2/thumb2-strb.ll
index 1ebb938..7978e7f 100644
--- a/test/CodeGen/Thumb2/thumb2-strb.ll
+++ b/test/CodeGen/Thumb2/thumb2-strb.ll
@@ -9,7 +9,7 @@ define i8 @f1(i8 %a, i8* %v) {
define i8 @f2(i8 %a, i8* %v) {
; CHECK: f2:
-; CHECK: strb.w r0, [r1, #+4092]
+; CHECK: strb.w r0, [r1, #4092]
%tmp2 = getelementptr i8* %v, i32 4092
store i8 %a, i8* %tmp2
ret i8 %a
diff --git a/test/CodeGen/Thumb2/thumb2-strh.ll b/test/CodeGen/Thumb2/thumb2-strh.ll
index b0eb8c1..97110a7 100644
--- a/test/CodeGen/Thumb2/thumb2-strh.ll
+++ b/test/CodeGen/Thumb2/thumb2-strh.ll
@@ -9,7 +9,7 @@ define i16 @f1(i16 %a, i16* %v) {
define i16 @f2(i16 %a, i16* %v) {
; CHECK: f2:
-; CHECK: strh.w r0, [r1, #+4092]
+; CHECK: strh.w r0, [r1, #4092]
%tmp2 = getelementptr i16* %v, i32 2046
store i16 %a, i16* %tmp2
ret i16 %a
diff --git a/test/CodeGen/X86/2007-01-08-InstrSched.ll b/test/CodeGen/X86/2007-01-08-InstrSched.ll
index 317ed0a..58e186b 100644
--- a/test/CodeGen/X86/2007-01-08-InstrSched.ll
+++ b/test/CodeGen/X86/2007-01-08-InstrSched.ll
@@ -11,12 +11,12 @@ define float @foo(float %x) nounwind {
%tmp14 = fadd float %tmp12, %tmp7
ret float %tmp14
-; CHECK: mulss LCPI1_3(%rip)
-; CHECK-NEXT: mulss LCPI1_0(%rip)
-; CHECK-NEXT: mulss LCPI1_1(%rip)
-; CHECK-NEXT: mulss LCPI1_2(%rip)
-; CHECK-NEXT: addss
-; CHECK-NEXT: addss
-; CHECK-NEXT: addss
-; CHECK-NEXT: ret
+; CHECK: mulss LCPI1_0(%rip)
+; CHECK: mulss LCPI1_1(%rip)
+; CHECK: addss
+; CHECK: mulss LCPI1_2(%rip)
+; CHECK: addss
+; CHECK: mulss LCPI1_3(%rip)
+; CHECK: addss
+; CHECK: ret
}
diff --git a/test/CodeGen/X86/2010-03-17-ISelBug.ll b/test/CodeGen/X86/2010-03-17-ISelBug.ll
new file mode 100644
index 0000000..609b4e2
--- /dev/null
+++ b/test/CodeGen/X86/2010-03-17-ISelBug.ll
@@ -0,0 +1,39 @@
+; RUN: llc < %s -mtriple=i386-apple-darwin5
+; rdar://7761790
+
+%"struct..0$_485" = type { i16, i16, i32 }
+%union.PPToken = type { %"struct..0$_485" }
+%struct.PPOperation = type { %union.PPToken, %union.PPToken, [6 x %union.PPToken], i32, i32, i32, [1 x i32], [0 x i8] }
+
+define i32* @t() align 2 nounwind {
+entry:
+ %operation = alloca %struct.PPOperation, align 8 ; <%struct.PPOperation*> [#uses=2]
+ %0 = load i32*** null, align 4 ; [#uses=1]
+ %1 = ptrtoint i32** %0 to i32 ; <i32> [#uses=1]
+ %2 = sub nsw i32 %1, undef ; <i32> [#uses=2]
+ br i1 false, label %bb20, label %bb.nph380
+
+bb20: ; preds = %entry
+ ret i32* null
+
+bb.nph380: ; preds = %entry
+ %scevgep403 = getelementptr %struct.PPOperation* %operation, i32 0, i32 1, i32 0, i32 2 ; <i32*> [#uses=1]
+ %3 = ashr i32 %2, 1 ; <i32> [#uses=1]
+ %tmp405 = and i32 %3, -2 ; <i32> [#uses=1]
+ %scevgep408 = getelementptr %struct.PPOperation* %operation, i32 0, i32 1, i32 0, i32 1 ; <i16*> [#uses=1]
+ %tmp410 = and i32 %2, -4 ; <i32> [#uses=1]
+ br label %bb169
+
+bb169: ; preds = %bb169, %bb.nph380
+ %index.6379 = phi i32 [ 0, %bb.nph380 ], [ %4, %bb169 ] ; <i32> [#uses=3]
+ %tmp404 = mul i32 %index.6379, -2 ; <i32> [#uses=1]
+ %tmp406 = add i32 %tmp405, %tmp404 ; <i32> [#uses=1]
+ %scevgep407 = getelementptr i32* %scevgep403, i32 %tmp406 ; <i32*> [#uses=1]
+ %tmp409 = mul i32 %index.6379, -4 ; <i32> [#uses=1]
+ %tmp411 = add i32 %tmp410, %tmp409 ; <i32> [#uses=1]
+ %scevgep412 = getelementptr i16* %scevgep408, i32 %tmp411 ; <i16*> [#uses=1]
+ store i16 undef, i16* %scevgep412, align 2
+ store i32 undef, i32* %scevgep407, align 4
+ %4 = add nsw i32 %index.6379, 1 ; <i32> [#uses=1]
+ br label %bb169
+}
diff --git a/test/CodeGen/X86/gather-addresses.ll b/test/CodeGen/X86/gather-addresses.ll
index 0719838..3e730de 100644
--- a/test/CodeGen/X86/gather-addresses.ll
+++ b/test/CodeGen/X86/gather-addresses.ll
@@ -1,4 +1,5 @@
; RUN: llc -march=x86-64 < %s | FileCheck %s
+; rdar://7398554
; When doing vector gather-scatter index calculation with 32-bit indices,
; bounce the vector off of cache rather than shuffling each individual
diff --git a/test/CodeGen/X86/lsr-reuse.ll b/test/CodeGen/X86/lsr-reuse.ll
index 2f6fb3f..ab71555 100644
--- a/test/CodeGen/X86/lsr-reuse.ll
+++ b/test/CodeGen/X86/lsr-reuse.ll
@@ -8,10 +8,10 @@ target triple = "x86_64-unknown-unknown"
; CHECK: full_me_0:
; CHECK: movsd (%rsi), %xmm0
-; CHECK: addq $8, %rsi
; CHECK: mulsd (%rdx), %xmm0
-; CHECK: addq $8, %rdx
; CHECK: movsd %xmm0, (%rdi)
+; CHECK: addq $8, %rsi
+; CHECK: addq $8, %rdx
; CHECK: addq $8, %rdi
; CHECK: decq %rcx
; CHECK: jne
@@ -53,10 +53,10 @@ return:
; CHECK: mulsd -2048(%rdx), %xmm0
; CHECK: movsd %xmm0, -2048(%rdi)
; CHECK: movsd (%rsi), %xmm0
-; CHECK: addq $8, %rsi
; CHECK: divsd (%rdx), %xmm0
-; CHECK: addq $8, %rdx
; CHECK: movsd %xmm0, (%rdi)
+; CHECK: addq $8, %rsi
+; CHECK: addq $8, %rdx
; CHECK: addq $8, %rdi
; CHECK: decq %rcx
; CHECK: jne
@@ -99,10 +99,10 @@ return:
; CHECK: mulsd (%rdx), %xmm0
; CHECK: movsd %xmm0, (%rdi)
; CHECK: movsd -2048(%rsi), %xmm0
-; CHECK: addq $8, %rsi
; CHECK: divsd -2048(%rdx), %xmm0
-; CHECK: addq $8, %rdx
; CHECK: movsd %xmm0, -2048(%rdi)
+; CHECK: addq $8, %rsi
+; CHECK: addq $8, %rdx
; CHECK: addq $8, %rdi
; CHECK: decq %rcx
; CHECK: jne
@@ -144,10 +144,10 @@ return:
; CHECK: mulsd (%rdx), %xmm0
; CHECK: movsd %xmm0, (%rdi)
; CHECK: movsd -4096(%rsi), %xmm0
-; CHECK: addq $8, %rsi
; CHECK: divsd -4096(%rdx), %xmm0
-; CHECK: addq $8, %rdx
; CHECK: movsd %xmm0, -4096(%rdi)
+; CHECK: addq $8, %rsi
+; CHECK: addq $8, %rdx
; CHECK: addq $8, %rdi
; CHECK: decq %rcx
; CHECK: jne
@@ -310,10 +310,10 @@ return:
; CHECK: addsd (%rsi), %xmm0
; CHECK: movsd %xmm0, (%rdx)
; CHECK: movsd 40(%rdi), %xmm0
-; CHECK: addq $8, %rdi
; CHECK: subsd 40(%rsi), %xmm0
-; CHECK: addq $8, %rsi
; CHECK: movsd %xmm0, 40(%rdx)
+; CHECK: addq $8, %rdi
+; CHECK: addq $8, %rsi
; CHECK: addq $8, %rdx
; CHECK: decq %rcx
; CHECK: jne
diff --git a/test/CodeGen/X86/sibcall.ll b/test/CodeGen/X86/sibcall.ll
index 90315fd..ce35b45 100644
--- a/test/CodeGen/X86/sibcall.ll
+++ b/test/CodeGen/X86/sibcall.ll
@@ -57,11 +57,11 @@ define void @t5(void ()* nocapture %x) nounwind ssp {
entry:
; 32: t5:
; 32-NOT: call
-; 32: jmpl *
+; 32: jmpl *4(%esp)
; 64: t5:
; 64-NOT: call
-; 64: jmpq *
+; 64: jmpq *%rdi
tail call void %x() nounwind
ret void
}
@@ -215,4 +215,59 @@ entry:
ret %struct.ns* %0
}
+; rdar://6195379
+; llvm can't do sibcall for this in 32-bit mode (yet).
declare fastcc %struct.ns* @foo7(%struct.cp* byval align 4, i8 signext) nounwind ssp
+
+%struct.__block_descriptor = type { i64, i64 }
+%struct.__block_descriptor_withcopydispose = type { i64, i64, i8*, i8* }
+%struct.__block_literal_1 = type { i8*, i32, i32, i8*, %struct.__block_descriptor* }
+%struct.__block_literal_2 = type { i8*, i32, i32, i8*, %struct.__block_descriptor_withcopydispose*, void ()* }
+
+define void @t14(%struct.__block_literal_2* nocapture %.block_descriptor) nounwind ssp {
+entry:
+; 64: t14:
+; 64: movq 32(%rdi)
+; 64-NOT: movq 16(%rdi)
+; 64: jmpq *16(%rdi)
+ %0 = getelementptr inbounds %struct.__block_literal_2* %.block_descriptor, i64 0, i32 5 ; <void ()**> [#uses=1]
+ %1 = load void ()** %0, align 8 ; <void ()*> [#uses=2]
+ %2 = bitcast void ()* %1 to %struct.__block_literal_1* ; <%struct.__block_literal_1*> [#uses=1]
+ %3 = getelementptr inbounds %struct.__block_literal_1* %2, i64 0, i32 3 ; <i8**> [#uses=1]
+ %4 = load i8** %3, align 8 ; <i8*> [#uses=1]
+ %5 = bitcast i8* %4 to void (i8*)* ; <void (i8*)*> [#uses=1]
+ %6 = bitcast void ()* %1 to i8* ; <i8*> [#uses=1]
+ tail call void %5(i8* %6) nounwind
+ ret void
+}
+
+; rdar://7726868
+%struct.foo = type { [4 x i32] }
+
+define void @t15(%struct.foo* noalias sret %agg.result) nounwind {
+; 32: t15:
+; 32: call {{_?}}f
+; 32: ret $4
+
+; 64: t15:
+; 64: callq {{_?}}f
+; 64: ret
+ tail call fastcc void @f(%struct.foo* noalias sret %agg.result) nounwind
+ ret void
+}
+
+declare void @f(%struct.foo* noalias sret) nounwind
+
+define void @t16() nounwind ssp {
+entry:
+; 32: t16:
+; 32: call {{_?}}bar4
+; 32: fstp
+
+; 64: t16:
+; 64: jmp {{_?}}bar4
+ %0 = tail call double @bar4() nounwind
+ ret void
+}
+
+declare double @bar4()
diff --git a/test/CodeGen/X86/sse2.ll b/test/CodeGen/X86/sse2.ll
index f2b8010..20b8eac 100644
--- a/test/CodeGen/X86/sse2.ll
+++ b/test/CodeGen/X86/sse2.ll
@@ -10,10 +10,10 @@ define void @t1(<2 x double>* %r, <2 x double>* %A, double %B) nounwind {
; CHECK: t1:
; CHECK: movl 8(%esp), %eax
-; CHECK-NEXT: movl 4(%esp), %ecx
; CHECK-NEXT: movapd (%eax), %xmm0
; CHECK-NEXT: movlpd 12(%esp), %xmm0
-; CHECK-NEXT: movapd %xmm0, (%ecx)
+; CHECK-NEXT: movl 4(%esp), %eax
+; CHECK-NEXT: movapd %xmm0, (%eax)
; CHECK-NEXT: ret
}
@@ -26,9 +26,9 @@ define void @t2(<2 x double>* %r, <2 x double>* %A, double %B) nounwind {
; CHECK: t2:
; CHECK: movl 8(%esp), %eax
-; CHECK-NEXT: movl 4(%esp), %ecx
; CHECK-NEXT: movapd (%eax), %xmm0
; CHECK-NEXT: movhpd 12(%esp), %xmm0
-; CHECK-NEXT: movapd %xmm0, (%ecx)
+; CHECK-NEXT: movl 4(%esp), %eax
+; CHECK-NEXT: movapd %xmm0, (%eax)
; CHECK-NEXT: ret
}
diff --git a/test/CodeGen/X86/sse3.ll b/test/CodeGen/X86/sse3.ll
index 921161e..e9c2c01 100644
--- a/test/CodeGen/X86/sse3.ll
+++ b/test/CodeGen/X86/sse3.ll
@@ -17,8 +17,8 @@ entry:
; X64: t0:
; X64: movddup (%rsi), %xmm0
-; X64: xorl %eax, %eax
; X64: pshuflw $0, %xmm0, %xmm0
+; X64: xorl %eax, %eax
; X64: pinsrw $0, %eax, %xmm0
; X64: movaps %xmm0, (%rdi)
; X64: ret
@@ -169,11 +169,11 @@ define internal void @t10() nounwind {
ret void
; X64: t10:
; X64: pextrw $4, %xmm0, %eax
-; X64: pextrw $6, %xmm0, %edx
; X64: movlhps %xmm1, %xmm1
; X64: pshuflw $8, %xmm1, %xmm1
; X64: pinsrw $2, %eax, %xmm1
-; X64: pinsrw $3, %edx, %xmm1
+; X64: pextrw $6, %xmm0, %eax
+; X64: pinsrw $3, %eax, %xmm1
}
@@ -184,8 +184,8 @@ entry:
ret <8 x i16> %tmp7
; X64: t11:
-; X64: movlhps %xmm0, %xmm0
; X64: movd %xmm1, %eax
+; X64: movlhps %xmm0, %xmm0
; X64: pshuflw $1, %xmm0, %xmm0
; X64: pinsrw $1, %eax, %xmm0
; X64: ret
@@ -198,8 +198,8 @@ entry:
ret <8 x i16> %tmp9
; X64: t12:
-; X64: movlhps %xmm0, %xmm0
; X64: pextrw $3, %xmm1, %eax
+; X64: movlhps %xmm0, %xmm0
; X64: pshufhw $3, %xmm0, %xmm0
; X64: pinsrw $5, %eax, %xmm0
; X64: ret
diff --git a/test/CodeGen/X86/sse42.ll b/test/CodeGen/X86/sse42.ll
index c9c4d01..1723909 100644
--- a/test/CodeGen/X86/sse42.ll
+++ b/test/CodeGen/X86/sse42.ll
@@ -9,10 +9,10 @@ define i32 @crc32_8(i32 %a, i8 %b) nounwind {
%tmp = call i32 @llvm.x86.sse42.crc32.8(i32 %a, i8 %b)
ret i32 %tmp
; X32: _crc32_8:
-; X32: crc32 8(%esp), %eax
+; X32: crc32b 8(%esp), %eax
; X64: _crc32_8:
-; X64: crc32 %sil, %eax
+; X64: crc32b %sil, %eax
}
@@ -20,10 +20,10 @@ define i32 @crc32_16(i32 %a, i16 %b) nounwind {
%tmp = call i32 @llvm.x86.sse42.crc32.16(i32 %a, i16 %b)
ret i32 %tmp
; X32: _crc32_16:
-; X32: crc32 8(%esp), %eax
+; X32: crc32w 8(%esp), %eax
; X64: _crc32_16:
-; X64: crc32 %si, %eax
+; X64: crc32w %si, %eax
}
@@ -31,8 +31,8 @@ define i32 @crc32_32(i32 %a, i32 %b) nounwind {
%tmp = call i32 @llvm.x86.sse42.crc32.32(i32 %a, i32 %b)
ret i32 %tmp
; X32: _crc32_32:
-; X32: crc32 8(%esp), %eax
+; X32: crc32l 8(%esp), %eax
; X64: _crc32_32:
-; X64: crc32 %esi, %eax
+; X64: crc32l %esi, %eax
}
diff --git a/test/CodeGen/X86/widen_load-2.ll b/test/CodeGen/X86/widen_load-2.ll
index 11383fa..58b557a 100644
--- a/test/CodeGen/X86/widen_load-2.ll
+++ b/test/CodeGen/X86/widen_load-2.ll
@@ -152,4 +152,28 @@ define void @add31i8(%i8vec31* nocapture sret %ret, %i8vec31* %ap, %i8vec31* %bp
%x = add %i8vec31 %a, %b
store %i8vec31 %x, %i8vec31* %ret, align 16
ret void
-} \ No newline at end of file
+}
+
+
+%i8vec3pack = type { <3 x i8>, i8 }
+define %i8vec3pack @rot() nounwind {
+; CHECK: shrb
+entry:
+ %X = alloca %i8vec3pack, align 4
+ %rot = alloca %i8vec3pack, align 4
+ %result = alloca %i8vec3pack, align 4
+ %storetmp = bitcast %i8vec3pack* %X to <3 x i8>*
+ store <3 x i8> <i8 -98, i8 -98, i8 -98>, <3 x i8>* %storetmp
+ %storetmp1 = bitcast %i8vec3pack* %rot to <3 x i8>*
+ store <3 x i8> <i8 1, i8 1, i8 1>, <3 x i8>* %storetmp1
+ %tmp = load %i8vec3pack* %X
+ %extractVec = extractvalue %i8vec3pack %tmp, 0
+ %tmp2 = load %i8vec3pack* %rot
+ %extractVec3 = extractvalue %i8vec3pack %tmp2, 0
+ %shr = lshr <3 x i8> %extractVec, %extractVec3
+ %storetmp4 = bitcast %i8vec3pack* %result to <3 x i8>*
+ store <3 x i8> %shr, <3 x i8>* %storetmp4
+ %tmp5 = load %i8vec3pack* %result
+ ret %i8vec3pack %tmp5
+}
+
diff --git a/test/DebugInfo/2010-03-19-DbgDeclare.ll b/test/DebugInfo/2010-03-19-DbgDeclare.ll
new file mode 100644
index 0000000..1f7a889
--- /dev/null
+++ b/test/DebugInfo/2010-03-19-DbgDeclare.ll
@@ -0,0 +1,12 @@
+; RUN: llvm-as < %s | opt -verify -disable-output
+
+define void @Foo(i32 %a, i32 %b) {
+entry:
+ call void @llvm.dbg.declare(metadata !{i32* null}, metadata !1)
+ ret void
+}
+
+!0 = metadata !{i32 662302, i32 26, metadata !1, null}
+!1 = metadata !{i32 4, metadata !"foo"}
+
+declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
diff --git a/test/FrontendObjC/2010-03-17-StructRef.m b/test/FrontendObjC/2010-03-17-StructRef.m
new file mode 100644
index 0000000..a8a509c
--- /dev/null
+++ b/test/FrontendObjC/2010-03-17-StructRef.m
@@ -0,0 +1,43 @@
+// RUN: %llvmgcc %s -S -o - | FileCheck %s
+// Bitfield references must not touch memory outside of the enclosing
+// struct. Radar 7639995
+typedef signed char BOOL;
+@protocol NSObject
+- (id)init;
+@end
+@interface NSObject <NSObject> {}
+@end
+@interface IMAVChatParticipant : NSObject {
+ int _ardRole;
+ int _state;
+ int _avRelayStatus;
+ int _chatEndedReason;
+ int _chatError;
+ unsigned _sendingAudio:1;
+ unsigned _sendingVideo:1;
+ unsigned _sendingAuxVideo:1;
+ unsigned _audioMuted:1;
+ unsigned _videoPaused:1;
+ unsigned _networkStalled:1;
+ unsigned _isInitiator:1;
+ unsigned _isAOLInterop:1;
+ unsigned _isRecording:1;
+ unsigned _isUsingICE:1;
+}
+@end
+@implementation IMAVChatParticipant
+- (id) init {
+ self = [super init];
+ if ( self ) {
+ BOOL blah = (BOOL)1;
+ // We're expecting these three bitfield assignments will generate i8 stores.
+ _sendingAudio = (BOOL)1;
+ _isUsingICE = (BOOL)1;
+ _isUsingICE = blah;
+ // CHECK: store i8
+ // CHECK: store i8
+ // CHECK: store i8
+ }
+ return self;
+}
+@end
diff --git a/test/LLVMC/AppendCmdHook.td b/test/LLVMC/AppendCmdHook.td
index 539a93f..254d5ea 100644
--- a/test/LLVMC/AppendCmdHook.td
+++ b/test/LLVMC/AppendCmdHook.td
@@ -2,6 +2,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/C++/dash-x.cpp b/test/LLVMC/C++/dash-x.cpp
index b32400e..7d4cf19 100644
--- a/test/LLVMC/C++/dash-x.cpp
+++ b/test/LLVMC/C++/dash-x.cpp
@@ -1,6 +1,7 @@
// Test that we can compile .c files as C++ and vice versa
// RUN: llvmc %s -x c++ %p/../test_data/false.c -x c %p/../test_data/false.cpp -x lisp -x whatnot -x none %p/../test_data/false2.cpp -o %t
// RUN: %abs_tmp | grep hello
+// XFAIL: vg
extern int test_main();
diff --git a/test/LLVMC/C++/hello.cpp b/test/LLVMC/C++/hello.cpp
index b9c6399..8f38306 100644
--- a/test/LLVMC/C++/hello.cpp
+++ b/test/LLVMC/C++/hello.cpp
@@ -1,6 +1,7 @@
// Test that we can compile C++ code.
// RUN: llvmc %s -o %t
// RUN: %abs_tmp | grep hello
+// XFAIL: vg
#include <iostream>
int main() {
diff --git a/test/LLVMC/C++/together.cpp b/test/LLVMC/C++/together.cpp
index e02f69a..925215a4 100644
--- a/test/LLVMC/C++/together.cpp
+++ b/test/LLVMC/C++/together.cpp
@@ -1,6 +1,7 @@
// Check that we can compile files of different types together.
// RUN: llvmc %s %p/../test_data/together.c -o %t
// RUN: %abs_tmp | grep hello
+// XFAIL: vg
extern "C" void test();
diff --git a/test/LLVMC/C/emit-llvm.c b/test/LLVMC/C/emit-llvm.c
index 38bbba6..9844bc7 100644
--- a/test/LLVMC/C/emit-llvm.c
+++ b/test/LLVMC/C/emit-llvm.c
@@ -1,4 +1,5 @@
// RUN: llvmc -c -emit-llvm -o - %s | llvm-dis | grep "@f0()" | count 1
+// XFAIL: vg_leak
int f0(void) {
}
diff --git a/test/LLVMC/C/hello.c b/test/LLVMC/C/hello.c
index b2d903f..29ad39f 100644
--- a/test/LLVMC/C/hello.c
+++ b/test/LLVMC/C/hello.c
@@ -2,6 +2,7 @@
* Check that we can compile helloworld
* RUN: llvmc %s -o %t
* RUN: %abs_tmp | grep hello
+ * XFAIL: vg_leak
*/
#include <stdio.h>
diff --git a/test/LLVMC/C/include.c b/test/LLVMC/C/include.c
index 07ae761..9c9530b 100644
--- a/test/LLVMC/C/include.c
+++ b/test/LLVMC/C/include.c
@@ -2,6 +2,7 @@
* Check that the 'include' options work.
* RUN: echo "int x;\n" > %t1.inc
* RUN: llvmc -include %t1.inc -fsyntax-only %s
+ * XFAIL: vg_leak
*/
int f0(void) {
diff --git a/test/LLVMC/C/opt-test.c b/test/LLVMC/C/opt-test.c
index d69dc9b..7924def 100644
--- a/test/LLVMC/C/opt-test.c
+++ b/test/LLVMC/C/opt-test.c
@@ -2,6 +2,7 @@
* Check that the -opt switch works.
* RUN: llvmc %s -opt -o %t
* RUN: %abs_tmp | grep hello
+ * XFAIL: vg_leak
*/
#include <stdio.h>
diff --git a/test/LLVMC/C/sink.c b/test/LLVMC/C/sink.c
index bdff340..c4f9beb 100644
--- a/test/LLVMC/C/sink.c
+++ b/test/LLVMC/C/sink.c
@@ -2,6 +2,7 @@
* Check that the 'sink' options work.
* RUN: llvmc -v -Wall %s -o %t |& grep "Wall"
* RUN: %abs_tmp | grep hello
+ * XFAIL: vg_leak
*/
#include <stdio.h>
diff --git a/test/LLVMC/C/wall.c b/test/LLVMC/C/wall.c
index f676099..36813ba 100644
--- a/test/LLVMC/C/wall.c
+++ b/test/LLVMC/C/wall.c
@@ -2,6 +2,7 @@
* Check that -Wall works as intended
* RUN: llvmc -Wall %s -o %t
* RUN: %abs_tmp | grep hello
+ * XFAIL: vg_leak
*/
#include <stdio.h>
diff --git a/test/LLVMC/EmptyCompilationGraph.td b/test/LLVMC/EmptyCompilationGraph.td
index 934905b..e5d5e9a 100644
--- a/test/LLVMC/EmptyCompilationGraph.td
+++ b/test/LLVMC/EmptyCompilationGraph.td
@@ -1,6 +1,7 @@
// Check that the compilation graph can be empty.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/EnvParentheses.td b/test/LLVMC/EnvParentheses.td
index c563171..86091db 100644
--- a/test/LLVMC/EnvParentheses.td
+++ b/test/LLVMC/EnvParentheses.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: not grep {FOO")));} %t
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ExternOptions.td b/test/LLVMC/ExternOptions.td
index 77cb4bf..d84ea84 100644
--- a/test/LLVMC/ExternOptions.td
+++ b/test/LLVMC/ExternOptions.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ForwardAs.td b/test/LLVMC/ForwardAs.td
index 7c3bd17..536b96a 100644
--- a/test/LLVMC/ForwardAs.td
+++ b/test/LLVMC/ForwardAs.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ForwardTransformedValue.td b/test/LLVMC/ForwardTransformedValue.td
index 2caef6c..5e0bf29 100644
--- a/test/LLVMC/ForwardTransformedValue.td
+++ b/test/LLVMC/ForwardTransformedValue.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ForwardValue.td b/test/LLVMC/ForwardValue.td
index 463235c..4c7a0ee 100644
--- a/test/LLVMC/ForwardValue.td
+++ b/test/LLVMC/ForwardValue.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/HookWithArguments.td b/test/LLVMC/HookWithArguments.td
index 312fa9c..5ff96cd 100644
--- a/test/LLVMC/HookWithArguments.td
+++ b/test/LLVMC/HookWithArguments.td
@@ -2,6 +2,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/HookWithInFile.td b/test/LLVMC/HookWithInFile.td
index f58e3f4..9855dbc 100644
--- a/test/LLVMC/HookWithInFile.td
+++ b/test/LLVMC/HookWithInFile.td
@@ -2,6 +2,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/Init.td b/test/LLVMC/Init.td
index ff9a0d8..05209bf 100644
--- a/test/LLVMC/Init.td
+++ b/test/LLVMC/Init.td
@@ -2,6 +2,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/MultiValuedOption.td b/test/LLVMC/MultiValuedOption.td
index b52af57..73ccb63 100644
--- a/test/LLVMC/MultiValuedOption.td
+++ b/test/LLVMC/MultiValuedOption.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/MultipleCompilationGraphs.td b/test/LLVMC/MultipleCompilationGraphs.td
index 9702248..86cd613 100644
--- a/test/LLVMC/MultipleCompilationGraphs.td
+++ b/test/LLVMC/MultipleCompilationGraphs.td
@@ -1,6 +1,7 @@
// Check that multiple compilation graphs are allowed.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/NoActions.td b/test/LLVMC/NoActions.td
index 015bfdd..a80bcfe 100644
--- a/test/LLVMC/NoActions.td
+++ b/test/LLVMC/NoActions.td
@@ -2,6 +2,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/NoCompilationGraph.td b/test/LLVMC/NoCompilationGraph.td
index 96c1f17..69df701 100644
--- a/test/LLVMC/NoCompilationGraph.td
+++ b/test/LLVMC/NoCompilationGraph.td
@@ -1,5 +1,6 @@
// Check that the compilation graph is not required.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/OneOrMore.td b/test/LLVMC/OneOrMore.td
index 42ec693..37fbc87 100644
--- a/test/LLVMC/OneOrMore.td
+++ b/test/LLVMC/OneOrMore.td
@@ -3,6 +3,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/OptionPreprocessor.td b/test/LLVMC/OptionPreprocessor.td
index 8a31481..c2641be 100644
--- a/test/LLVMC/OptionPreprocessor.td
+++ b/test/LLVMC/OptionPreprocessor.td
@@ -2,6 +2,7 @@
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
// RUN: %compile_cxx -fexceptions -x c++ %t
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/TestWarnings.td b/test/LLVMC/TestWarnings.td
index 9523e24..0388cb0 100644
--- a/test/LLVMC/TestWarnings.td
+++ b/test/LLVMC/TestWarnings.td
@@ -1,6 +1,7 @@
// Check that warnings about unused options are really emitted.
// This should fail because the output is printed on stderr.
-// RUN: ignore tblgen -I %p/../../include --gen-llvmc %s |& grep "option '-Wall' has no effect!"
+// RUN: tblgen -I %p/../../include --gen-llvmc %s |& grep "option '-Wall' has no effect!"
+// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
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: ])
diff --git a/test/TableGen/2003-08-03-PassCode.td b/test/TableGen/2003-08-03-PassCode.td
index 7142186..c02f499 100644
--- a/test/TableGen/2003-08-03-PassCode.td
+++ b/test/TableGen/2003-08-03-PassCode.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
class test<code C> {
code Code = C;
diff --git a/test/TableGen/2006-09-18-LargeInt.td b/test/TableGen/2006-09-18-LargeInt.td
index afd813f..194699a 100644
--- a/test/TableGen/2006-09-18-LargeInt.td
+++ b/test/TableGen/2006-09-18-LargeInt.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep -- 4294901760
+// XFAIL: vg_leak
def X {
int Y = 0xFFFF0000;
diff --git a/test/TableGen/AnonDefinitionOnDemand.td b/test/TableGen/AnonDefinitionOnDemand.td
index d567fc8..b10ad58 100644
--- a/test/TableGen/AnonDefinitionOnDemand.td
+++ b/test/TableGen/AnonDefinitionOnDemand.td
@@ -1,4 +1,5 @@
// RUN: tblgen < %s
+// XFAIL: vg_leak
class foo<int X> { int THEVAL = X; }
def foo_imp : foo<1>;
diff --git a/test/TableGen/DagDefSubst.td b/test/TableGen/DagDefSubst.td
index e5eebe9..92a207f 100644
--- a/test/TableGen/DagDefSubst.td
+++ b/test/TableGen/DagDefSubst.td
@@ -1,5 +1,6 @@
// RUN: tblgen %s | grep {dag d = (X Y)}
// RUN: tblgen %s | grep {dag e = (Y X)}
+// XFAIL: vg_leak
def X;
class yclass;
diff --git a/test/TableGen/DagIntSubst.td b/test/TableGen/DagIntSubst.td
index 3c1291c..00fde69 100644
--- a/test/TableGen/DagIntSubst.td
+++ b/test/TableGen/DagIntSubst.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {dag d = (X 13)}
+// XFAIL: vg_leak
def X;
class C<int N> {
diff --git a/test/TableGen/DefmInherit.td b/test/TableGen/DefmInherit.td
index 4f37edf..9e16670 100644
--- a/test/TableGen/DefmInherit.td
+++ b/test/TableGen/DefmInherit.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {zing = 4} | count 4
+// XFAIL: vg_leak
class C1<int A, string B> {
int bar = A;
diff --git a/test/TableGen/ForwardRef.td b/test/TableGen/ForwardRef.td
index 2056b1f..955cc14 100644
--- a/test/TableGen/ForwardRef.td
+++ b/test/TableGen/ForwardRef.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s -o -
+// XFAIL: vg_leak
class bar {
list<bar> x;
diff --git a/test/TableGen/GeneralList.td b/test/TableGen/GeneralList.td
index 7f099f2..ca92a21 100644
--- a/test/TableGen/GeneralList.td
+++ b/test/TableGen/GeneralList.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
//
// Test to make sure that lists work with any data-type
diff --git a/test/TableGen/IntBitInit.td b/test/TableGen/IntBitInit.td
index b949bfe..16ac9c8 100644
--- a/test/TableGen/IntBitInit.td
+++ b/test/TableGen/IntBitInit.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
def {
bit A = 1;
int B = A;
diff --git a/test/TableGen/LazyChange.td b/test/TableGen/LazyChange.td
index 145fd0b..fa53562 100644
--- a/test/TableGen/LazyChange.td
+++ b/test/TableGen/LazyChange.td
@@ -1,5 +1,5 @@
// RUN: tblgen %s | grep {int Y = 3}
-
+// XFAIL: vg_leak
class C {
int X = 4;
diff --git a/test/TableGen/ListArgs.td b/test/TableGen/ListArgs.td
index daa0de6..a513db6 100644
--- a/test/TableGen/ListArgs.td
+++ b/test/TableGen/ListArgs.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
class B<list<int> v> {
list<int> vals = v;
diff --git a/test/TableGen/ListArgsSimple.td b/test/TableGen/ListArgsSimple.td
index b3b2078..f7caed6 100644
--- a/test/TableGen/ListArgsSimple.td
+++ b/test/TableGen/ListArgsSimple.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
class B<int v> {
int val = v;
diff --git a/test/TableGen/ListConversion.td b/test/TableGen/ListConversion.td
index 773ed6e..222b614 100644
--- a/test/TableGen/ListConversion.td
+++ b/test/TableGen/ListConversion.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
class A;
class B : A;
diff --git a/test/TableGen/ListSlices.td b/test/TableGen/ListSlices.td
index be794cf..5848a4e 100644
--- a/test/TableGen/ListSlices.td
+++ b/test/TableGen/ListSlices.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
def A {
list<int> B = [10, 20, 30, 4, 1, 1231, 20];
diff --git a/test/TableGen/MultiClass.td b/test/TableGen/MultiClass.td
index 52ba59c..9f92b73 100644
--- a/test/TableGen/MultiClass.td
+++ b/test/TableGen/MultiClass.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {zing = 4} | count 2
+// XFAIL: vg_leak
class C1<int A, string B> {
int bar = A;
diff --git a/test/TableGen/MultiClassDefName.td b/test/TableGen/MultiClassDefName.td
index 2e71f7d..138c93d 100644
--- a/test/TableGen/MultiClassDefName.td
+++ b/test/TableGen/MultiClassDefName.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep WorldHelloCC | count 1
+// XFAIL: vg_leak
class C<string n> {
string name = n;
diff --git a/test/TableGen/MultiClassInherit.td b/test/TableGen/MultiClassInherit.td
index d4c4ce5..9da80ba 100644
--- a/test/TableGen/MultiClassInherit.td
+++ b/test/TableGen/MultiClassInherit.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {zing = 4} | count 28
+// XFAIL: vg_leak
class C1<int A, string B> {
int bar = A;
diff --git a/test/TableGen/Slice.td b/test/TableGen/Slice.td
index cd9c6da..22bf7fb 100644
--- a/test/TableGen/Slice.td
+++ b/test/TableGen/Slice.td
@@ -1,5 +1,6 @@
// RUN: tblgen %s | grep {\\\[(set} | count 2
// RUN: tblgen %s | grep {\\\[\\\]} | count 2
+// XFAIL: vg_leak
class ValueType<int size, int value> {
int Size = size;
diff --git a/test/TableGen/String.td b/test/TableGen/String.td
index d2ae451..fc0f5b8 100644
--- a/test/TableGen/String.td
+++ b/test/TableGen/String.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
class x {
string y = "missing terminating '\"' character";
}
diff --git a/test/TableGen/SuperSubclassSameName.td b/test/TableGen/SuperSubclassSameName.td
index 087df87..304c883 100644
--- a/test/TableGen/SuperSubclassSameName.td
+++ b/test/TableGen/SuperSubclassSameName.td
@@ -1,4 +1,5 @@
// RUN: tblgen < %s
+// XFAIL: vg_leak
// Test for template arguments that have the same name as superclass template
// arguments.
diff --git a/test/TableGen/TargetInstrInfo.td b/test/TableGen/TargetInstrInfo.td
index 8299541..2871eb8 100644
--- a/test/TableGen/TargetInstrInfo.td
+++ b/test/TableGen/TargetInstrInfo.td
@@ -1,6 +1,7 @@
// This test describes how we eventually want to describe instructions in
// the target independent code generators.
// RUN: tblgen %s
+// XFAIL: vg_leak
// Target indep stuff.
class Instruction { // Would have other stuff eventually
diff --git a/test/TableGen/TargetInstrSpec.td b/test/TableGen/TargetInstrSpec.td
index 7c3dd57..a7ca902 100644
--- a/test/TableGen/TargetInstrSpec.td
+++ b/test/TableGen/TargetInstrSpec.td
@@ -1,5 +1,6 @@
// RUN: tblgen %s | grep {\\\[(set VR128:\$dst, (int_x86_sse2_add_pd VR128:\$src1, VR128:\$src2))\\\]} | count 1
// RUN: tblgen %s | grep {\\\[(set VR128:\$dst, (int_x86_sse2_add_ps VR128:\$src1, VR128:\$src2))\\\]} | count 1
+// XFAIL: vg_leak
class ValueType<int size, int value> {
int Size = size;
diff --git a/test/TableGen/TemplateArgRename.td b/test/TableGen/TemplateArgRename.td
index 535c2e4..ee5d2cf 100644
--- a/test/TableGen/TemplateArgRename.td
+++ b/test/TableGen/TemplateArgRename.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
// Make sure there is no collision between XX and XX.
def S;
diff --git a/test/TableGen/Tree.td b/test/TableGen/Tree.td
index f9f1f15..2796cfd 100644
--- a/test/TableGen/Tree.td
+++ b/test/TableGen/Tree.td
@@ -1,5 +1,6 @@
// This tests to make sure we can parse tree patterns.
// RUN: tblgen %s
+// XFAIL: vg_leak
class TreeNode;
class RegisterClass;
diff --git a/test/TableGen/TreeNames.td b/test/TableGen/TreeNames.td
index 05a3298..ccdeb88 100644
--- a/test/TableGen/TreeNames.td
+++ b/test/TableGen/TreeNames.td
@@ -1,5 +1,6 @@
// This tests to make sure we can parse tree patterns with names.
// RUN: tblgen %s
+// XFAIL: vg_leak
class TreeNode;
class RegisterClass;
diff --git a/test/TableGen/UnsetBitInit.td b/test/TableGen/UnsetBitInit.td
index 91342ec..ff70108 100644
--- a/test/TableGen/UnsetBitInit.td
+++ b/test/TableGen/UnsetBitInit.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s
+// XFAIL: vg_leak
class x {
field bits<32> A;
}
diff --git a/test/TableGen/cast.td b/test/TableGen/cast.td
index 4a771ae..8164e74 100644
--- a/test/TableGen/cast.td
+++ b/test/TableGen/cast.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {add_ps} | count 3
+// XFAIL: vg_leak
class ValueType<int size, int value> {
int Size = size;
diff --git a/test/TableGen/eq.td b/test/TableGen/eq.td
index 8ba6d7e..518a80a 100644
--- a/test/TableGen/eq.td
+++ b/test/TableGen/eq.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | FileCheck %s
+// XFAIL: vg_leak
// CHECK: Value = 0
// CHECK: Value = 1
diff --git a/test/TableGen/foreach.td b/test/TableGen/foreach.td
index acce449..d4d81f8 100644
--- a/test/TableGen/foreach.td
+++ b/test/TableGen/foreach.td
@@ -1,6 +1,7 @@
// RUN: tblgen %s | grep {Jr} | count 2
// RUN: tblgen %s | grep {Sr} | count 2
// RUN: tblgen %s | grep {NAME} | count 1
+// XFAIL: vg_leak
// Variables for foreach
class decls {
diff --git a/test/TableGen/if.td b/test/TableGen/if.td
index 9b24382..0bac0ba 100644
--- a/test/TableGen/if.td
+++ b/test/TableGen/if.td
@@ -1,5 +1,6 @@
// RUN: tblgen %s | grep {\\\[1, 2, 3\\\]} | count 4
// RUN: tblgen %s | grep {\\\[4, 5, 6\\\]} | count 2
+// XFAIL: vg_leak
class A<list<list<int>> vals> {
list<int> first = vals[0];
diff --git a/test/TableGen/lisp.td b/test/TableGen/lisp.td
index 3e392fd..b521e04 100644
--- a/test/TableGen/lisp.td
+++ b/test/TableGen/lisp.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {}
+// XFAIL: vg_leak
class List<list<string> n> {
list<string> names = n;
diff --git a/test/TableGen/nameconcat.td b/test/TableGen/nameconcat.td
index fc865f9..fd2880a 100644
--- a/test/TableGen/nameconcat.td
+++ b/test/TableGen/nameconcat.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep {add_ps} | count 3
+// XFAIL: vg_leak
class ValueType<int size, int value> {
int Size = size;
diff --git a/test/TableGen/strconcat.td b/test/TableGen/strconcat.td
index fc0d805..38409a9 100644
--- a/test/TableGen/strconcat.td
+++ b/test/TableGen/strconcat.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | grep fufoo
+// XFAIL: vg_leak
class Y<string S> {
string T = !strconcat(S, "foo");
diff --git a/test/TableGen/subst.td b/test/TableGen/subst.td
index ce9f45d..05d424f 100644
--- a/test/TableGen/subst.td
+++ b/test/TableGen/subst.td
@@ -4,6 +4,7 @@
// RUN: tblgen %s | grep {LAST} | count 1
// RUN: tblgen %s | grep {TVAR} | count 2
// RUN: tblgen %s | grep {Bogus} | count 1
+// XFAIL: vg_leak
class Honorific<string t> {
string honorific = t;
diff --git a/test/TableGen/subst2.td b/test/TableGen/subst2.td
index 3366c9d..584266e 100644
--- a/test/TableGen/subst2.td
+++ b/test/TableGen/subst2.td
@@ -1,4 +1,5 @@
// RUN: tblgen %s | FileCheck %s
+// XFAIL: vg_leak
// CHECK: No subst
// CHECK: No foo
// CHECK: RECURSE foo
diff --git a/test/lit.cfg b/test/lit.cfg
index 929871a..fd3120a 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -128,6 +128,10 @@ excludes = []
# Provide target_triple for use in XFAIL and XTARGET.
config.target_triple = site_exp['target_triplet']
+# When running under valgrind, we mangle '-vg' or '-vg_leak' onto the end of the
+# triple so we can check it with XFAIL and XTARGET.
+config.target_triple += lit.valgrindTriple
+
# Provide llvm_supports_target for use in local configs.
targets = set(site_exp["TARGETS_TO_BUILD"].split())
def llvm_supports_target(name):
OpenPOWER on IntegriCloud