summaryrefslogtreecommitdiff
path: root/test/DebugInfo/X86
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-04-26 19:45:00 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-04-26 19:45:00 +0000
commit12f3ca4cdb95b193af905a00e722a4dcb40b3de3 (patch)
treeae1a7fcfc24a8d4b23206c57121c3f361d4b7f84 /test/DebugInfo/X86
parentd99dafe2e4a385dd2a6c76da6d8258deb100657b (diff)
Notes
Diffstat (limited to 'test/DebugInfo/X86')
-rw-r--r--test/DebugInfo/X86/cu-ranges-odr.ll2
-rw-r--r--test/DebugInfo/X86/cu-ranges.ll4
-rw-r--r--test/DebugInfo/X86/debug-loc-asan.ll4
-rw-r--r--test/DebugInfo/X86/dwarf-pubnames-split.ll2
-rw-r--r--test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s70
-rw-r--r--test/DebugInfo/X86/empty.ll2
-rw-r--r--test/DebugInfo/X86/fission-cu.ll2
-rw-r--r--test/DebugInfo/X86/fission-hash.ll2
-rw-r--r--test/DebugInfo/X86/fission-inline.ll2
-rw-r--r--test/DebugInfo/X86/fission-no-inlining.ll2
-rw-r--r--test/DebugInfo/X86/fission-ranges.ll2
-rw-r--r--test/DebugInfo/X86/generate-odr-hash.ll2
-rw-r--r--test/DebugInfo/X86/op_deref.ll2
-rw-r--r--test/DebugInfo/X86/pieces-4.ll4
-rw-r--r--test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll46
-rw-r--r--test/DebugInfo/X86/sret.ll2
-rw-r--r--test/DebugInfo/X86/stack-value-dwarf2.ll96
-rw-r--r--test/DebugInfo/X86/this-stack_value.ll123
-rw-r--r--test/DebugInfo/X86/tls.ll2
-rw-r--r--test/DebugInfo/X86/type_units_with_addresses.ll4
-rw-r--r--test/DebugInfo/X86/vla.ll2
21 files changed, 356 insertions, 21 deletions
diff --git a/test/DebugInfo/X86/cu-ranges-odr.ll b/test/DebugInfo/X86/cu-ranges-odr.ll
index cf54aeeb87b1a..e2ee29b55d889 100644
--- a/test/DebugInfo/X86/cu-ranges-odr.ll
+++ b/test/DebugInfo/X86/cu-ranges-odr.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=CHECK-RELOCS %s
diff --git a/test/DebugInfo/X86/cu-ranges.ll b/test/DebugInfo/X86/cu-ranges.ll
index af129c7525dec..f2540589b24a2 100644
--- a/test/DebugInfo/X86/cu-ranges.ll
+++ b/test/DebugInfo/X86/cu-ranges.ll
@@ -1,8 +1,8 @@
-; RUN: llc -split-dwarf=Enable -O0 %s -function-sections -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -function-sections -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-dump=abbrev %t | FileCheck --check-prefix=FUNCTION-SECTIONS %s
; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=FUNCTION-SECTIONS-RELOCS %s
-; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-dump=abbrev %t | FileCheck --check-prefix=NO-FUNCTION-SECTIONS %s
; From:
diff --git a/test/DebugInfo/X86/debug-loc-asan.ll b/test/DebugInfo/X86/debug-loc-asan.ll
index e4449a29281c2..8f798094dffa2 100644
--- a/test/DebugInfo/X86/debug-loc-asan.ll
+++ b/test/DebugInfo/X86/debug-loc-asan.ll
@@ -12,10 +12,10 @@
; The address of the (potentially now malloc'ed) alloca ends up
; in RDI, after which it is spilled to the stack. We record the
; spill OFFSET on the stack for checking the debug info below.
-; CHECK: #DEBUG_VALUE: bar:y <- [%RDI+0]
+; CHECK: #DEBUG_VALUE: bar:y <- [DW_OP_deref] [%RDI+0]
; CHECK: movq %rdi, [[OFFSET:[0-9]+]](%rsp)
; CHECK-NEXT: [[START_LABEL:.Ltmp[0-9]+]]
-; CHECK-NEXT: #DEBUG_VALUE: bar:y <- [complex expression]
+; CHECK-NEXT: #DEBUG_VALUE: bar:y <- [DW_OP_deref, DW_OP_deref]
; This location should be valid until the end of the function.
; CHECK: movq %rbp, %rsp
diff --git a/test/DebugInfo/X86/dwarf-pubnames-split.ll b/test/DebugInfo/X86/dwarf-pubnames-split.ll
index fcec66cc76b45..6685615dc8313 100644
--- a/test/DebugInfo/X86/dwarf-pubnames-split.ll
+++ b/test/DebugInfo/X86/dwarf-pubnames-split.ll
@@ -1,4 +1,4 @@
-; RUN: llc -mtriple=x86_64-pc-linux-gnu -split-dwarf=Enable %s -o - | FileCheck %s
+; RUN: llc -mtriple=x86_64-pc-linux-gnu -split-dwarf-file=foo.dwo %s -o - | FileCheck %s
; Derived from:
; int main (void) {
diff --git a/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s b/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s
new file mode 100644
index 0000000000000..a62c86fafac2e
--- /dev/null
+++ b/test/DebugInfo/X86/dwarfdump-ranges-unrelocated.s
@@ -0,0 +1,70 @@
+# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t
+# RUN: llvm-dwarfdump %t | FileCheck %s
+
+# CHECK: .debug_ranges contents:
+# CHECK: 00000000 0000000000000000 0000000000000001
+# CHECK: 00000000 0000000000000000 0000000000000002
+# CHECK: 00000000 <End of list>
+
+## Asm code for testcase is a reduced output from next invocation and source:
+# clang test.cpp -S -o test.s -gmlt -ffunction-sections
+# test.cpp:
+# void foo1() { }
+# void foo2() { }
+
+.section .text.foo1,"ax",@progbits
+.Lfunc_begin0:
+ nop
+.Lfunc_end0:
+
+.section .text.foo2,"ax",@progbits
+.Lfunc_begin1:
+ nop
+ nop
+.Lfunc_end1:
+
+.section .debug_abbrev,"",@progbits
+.byte 1 # Abbreviation Code
+.byte 17 # DW_TAG_compile_unit
+.byte 0 # DW_CHILDREN_no
+.byte 37 # DW_AT_producer
+.byte 14 # DW_FORM_strp
+.byte 19 # DW_AT_language
+.byte 5 # DW_FORM_data2
+.byte 3 # DW_AT_name
+.byte 14 # DW_FORM_strp
+.byte 16 # DW_AT_stmt_list
+.byte 23 # DW_FORM_sec_offset
+.byte 27 # DW_AT_comp_dir
+.byte 14 # DW_FORM_strp
+.byte 17 # DW_AT_low_pc
+.byte 1 # DW_FORM_addr
+.byte 85 # DW_AT_ranges
+.byte 23 # DW_FORM_sec_offset
+.byte 0 # EOM(1)
+.byte 0 # EOM(2)
+.byte 0 # EOM(3)
+
+.section .debug_info,"",@progbits
+.Lcu_begin0:
+.long 38 # Length of Unit
+.short 4 # DWARF version number
+.long .debug_abbrev # Offset Into Abbrev. Section
+.byte 8 # Address Size (in bytes)
+.byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit
+.long 0 # DW_AT_producer
+.short 4 # DW_AT_language
+.long 0 # DW_AT_name
+.long 0 # DW_AT_stmt_list
+.long 0 # DW_AT_comp_dir
+.quad 0 # DW_AT_low_pc
+.long .Ldebug_ranges0 # DW_AT_ranges
+
+.section .debug_ranges,"",@progbits
+.Ldebug_ranges0:
+.quad .Lfunc_begin0
+.quad .Lfunc_end0
+.quad .Lfunc_begin1
+.quad .Lfunc_end1
+.quad 0
+.quad 0
diff --git a/test/DebugInfo/X86/empty.ll b/test/DebugInfo/X86/empty.ll
index e156e3bbe5e29..774b908adb303 100644
--- a/test/DebugInfo/X86/empty.ll
+++ b/test/DebugInfo/X86/empty.ll
@@ -1,5 +1,5 @@
; RUN: llc -mtriple i686-pc-cygwin < %s -filetype=obj | llvm-dwarfdump - | FileCheck %s
-; RUN: llc -mtriple i686-pc-cygwin -split-dwarf=Enable < %s -filetype=obj | llvm-dwarfdump - | FileCheck --check-prefix=FISSION %s
+; RUN: llc -mtriple i686-pc-cygwin -split-dwarf-file=foo.dwo < %s -filetype=obj | llvm-dwarfdump - | FileCheck --check-prefix=FISSION %s
; Expect no line table entry since there are no functions and file references in this compile unit
; CHECK: .debug_line contents:
diff --git a/test/DebugInfo/X86/fission-cu.ll b/test/DebugInfo/X86/fission-cu.ll
index 1ca2372fbadd2..51f4584a2826a 100644
--- a/test/DebugInfo/X86/fission-cu.ll
+++ b/test/DebugInfo/X86/fission-cu.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=baz.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s
; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
diff --git a/test/DebugInfo/X86/fission-hash.ll b/test/DebugInfo/X86/fission-hash.ll
index 7273e4c675c55..1a5fba293175b 100644
--- a/test/DebugInfo/X86/fission-hash.ll
+++ b/test/DebugInfo/X86/fission-hash.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
; The source is an empty file.
diff --git a/test/DebugInfo/X86/fission-inline.ll b/test/DebugInfo/X86/fission-inline.ll
index 85c594c118a21..45e0127294d1f 100644
--- a/test/DebugInfo/X86/fission-inline.ll
+++ b/test/DebugInfo/X86/fission-inline.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj > %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj > %t
; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
; RUN: llvm-objdump -r %t | FileCheck --check-prefix=RELOCS %s
diff --git a/test/DebugInfo/X86/fission-no-inlining.ll b/test/DebugInfo/X86/fission-no-inlining.ll
index 3f1e087f9ba83..5a80d61b5a423 100644
--- a/test/DebugInfo/X86/fission-no-inlining.ll
+++ b/test/DebugInfo/X86/fission-no-inlining.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
+; RUN: llc -split-dwarf-file=foo.dwo -O0 < %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
; CHECK-NOT: DW_TAG_subprogram
diff --git a/test/DebugInfo/X86/fission-ranges.ll b/test/DebugInfo/X86/fission-ranges.ll
index 60d0f1777a430..bd3b8526b8887 100644
--- a/test/DebugInfo/X86/fission-ranges.ll
+++ b/test/DebugInfo/X86/fission-ranges.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump %t | FileCheck %s
; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
diff --git a/test/DebugInfo/X86/generate-odr-hash.ll b/test/DebugInfo/X86/generate-odr-hash.ll
index 7b3a291f56657..e9303e6a2658e 100644
--- a/test/DebugInfo/X86/generate-odr-hash.ll
+++ b/test/DebugInfo/X86/generate-odr-hash.ll
@@ -4,7 +4,7 @@
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=SINGLE %s
; RUN: llvm-readobj -s -t %t | FileCheck --check-prefix=OBJ_SINGLE %s
-; RUN: llc < %s -split-dwarf=Enable -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
+; RUN: llc < %s -split-dwarf-file=foo.dwo -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=FISSION %s
; RUN: llvm-readobj -s -t %t | FileCheck --check-prefix=OBJ_FISSION %s
diff --git a/test/DebugInfo/X86/op_deref.ll b/test/DebugInfo/X86/op_deref.ll
index bfec43757d1da..2d375352f6f7f 100644
--- a/test/DebugInfo/X86/op_deref.ll
+++ b/test/DebugInfo/X86/op_deref.ll
@@ -20,7 +20,7 @@
; right now, so we check the asm output:
; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o - -filetype=asm | FileCheck %s -check-prefix=ASM-CHECK
; vla should have a register-indirect address at one point.
-; ASM-CHECK: DEBUG_VALUE: vla <- [%RCX+0]
+; ASM-CHECK: DEBUG_VALUE: vla <- [DW_OP_deref] [%RCX+0]
; ASM-CHECK: DW_OP_breg2
; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s --check-prefix=PRETTY-PRINT
diff --git a/test/DebugInfo/X86/pieces-4.ll b/test/DebugInfo/X86/pieces-4.ll
index 124463691e196..121cb7c425c67 100644
--- a/test/DebugInfo/X86/pieces-4.ll
+++ b/test/DebugInfo/X86/pieces-4.ll
@@ -15,8 +15,8 @@
; CHECK-LABEL: bitpiece_spill: # @bitpiece_spill
; CHECK: callq g
; CHECK: movl %eax, [[offs:[0-9]+]](%rsp) # 4-byte Spill
-; CHECK: #DEBUG_VALUE: bitpiece_spill:o [fragment offset=32 size=32] <- 0
-; CHECK: #DEBUG_VALUE: bitpiece_spill:o [fragment offset=0 size=32] <- [%RSP+[[offs]]]
+; CHECK: #DEBUG_VALUE: bitpiece_spill:o <- [DW_OP_LLVM_fragment 32 32] 0
+; CHECK: #DEBUG_VALUE: bitpiece_spill:o <- [DW_OP_LLVM_fragment 0 32] [%RSP+[[offs]]]
; CHECK: #APP
; CHECK: #NO_APP
; CHECK: movl [[offs]](%rsp), %eax # 4-byte Reload
diff --git a/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll b/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll
new file mode 100644
index 0000000000000..c6f0afa279372
--- /dev/null
+++ b/test/DebugInfo/X86/split-dwarf-cross-unit-reference.ll
@@ -0,0 +1,46 @@
+; RUN: llc -mtriple=x86_64-linux -split-dwarf-file=foo.dwo -filetype=obj -o - < %s | llvm-objdump -r - | FileCheck %s
+
+; CHECK-NOT: .rel{{a?}}.debug_info.dwo
+; CHECK: RELOCATION RECORDS FOR [.rel{{a?}}.debug_info]:
+; CHECK-NOT: RELOCATION RECORDS
+; Expect one relocation in debug_info, between f3 and f1.
+; CHECK: R_X86_64_32 .debug_info
+; CHECK-NOT: .debug_info
+; CHECK: RELOCATION RECORDS
+; CHECK-NOT: .rel{{a?}}.debug_info.dwo
+
+
+; Function Attrs: noinline nounwind optnone uwtable
+define void @_Z2f1v() !dbg !7 {
+entry:
+ ret void, !dbg !10
+}
+
+; Function Attrs: noinline uwtable
+define void @_Z2f3v() !dbg !13 {
+entry:
+ call void @_Z2f1v(), !dbg !14
+ ret void, !dbg !16
+}
+
+!llvm.dbg.cu = !{!0, !3}
+!llvm.ident = !{!5, !5}
+!llvm.module.flags = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 301051) (llvm/trunk 301062)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "a.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
+!2 = !{}
+!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "clang version 5.0.0 (trunk 301051) (llvm/trunk 301062)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!4 = !DIFile(filename: "b.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
+!5 = !{!"clang version 5.0.0 (trunk 301051) (llvm/trunk 301062)"}
+!6 = !{i32 2, !"Debug Info Version", i32 3}
+!7 = distinct !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{null}
+!10 = !DILocation(line: 1, scope: !7)
+!11 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
+!12 = !DILocation(line: 1, scope: !11)
+!13 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !4, file: !4, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !3, variables: !2)
+!14 = !DILocation(line: 1, scope: !11, inlinedAt: !15)
+!15 = distinct !DILocation(line: 1, scope: !13)
+!16 = !DILocation(line: 1, scope: !13)
diff --git a/test/DebugInfo/X86/sret.ll b/test/DebugInfo/X86/sret.ll
index c4bb005a36681..152a1b9bfd944 100644
--- a/test/DebugInfo/X86/sret.ll
+++ b/test/DebugInfo/X86/sret.ll
@@ -1,4 +1,4 @@
-; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
+; RUN: llc -split-dwarf-file=foo.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s --check-prefix=CHECK-DWO
; Based on the debuginfo-tests/sret.cpp code.
diff --git a/test/DebugInfo/X86/stack-value-dwarf2.ll b/test/DebugInfo/X86/stack-value-dwarf2.ll
new file mode 100644
index 0000000000000..61595f7861fe4
--- /dev/null
+++ b/test/DebugInfo/X86/stack-value-dwarf2.ll
@@ -0,0 +1,96 @@
+; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
+; Note that it would be even better to avoid emitting the empty piece.
+; CHECK: Location description: 93 08
+; piece 0x00000008
+source_filename = "bugpoint-reduced-simplified.ll"
+target triple = "i386-apple-ios7.0.0"
+
+%class.K = type { %class.N, %struct.F, i32 }
+%class.N = type { %struct.B }
+%struct.B = type { i8 }
+%struct.F = type { i8 }
+%struct.ConditionPlatformHelper = type { i8 }
+%"struct.J<K::L, false, int>::Node" = type { %"class.K::L" }
+%"class.K::L" = type { %class.__thread_id }
+%class.__thread_id = type { i32 }
+%"struct.K::M" = type { %class.I, %class.H }
+%class.I = type { i32 }
+%class.H = type { i32 }
+
+; Function Attrs: nounwind
+define void @_Z34swift_getGenericMetadata_argumentsv() #0 !dbg !5 {
+entry:
+ %ref.tmp = alloca %class.K, align 8
+ %0 = getelementptr inbounds %class.K, %class.K* %ref.tmp, i32 0, i32 0, i32 0, i32 0
+ %call = tail call i64 @_Z8getCacheP23ConditionPlatformHelper(%struct.ConditionPlatformHelper* undef)
+ %1 = bitcast %class.K* %ref.tmp to i64*
+ %LastSearch.i.i = getelementptr inbounds %class.K, %class.K* %ref.tmp, i32 0, i32 0, i32 0
+ %call.i.i = call %"struct.J<K::L, false, int>::Node"* @_ZN1BIPN1JIN1K1LELb0EiE4NodeEE4loadEv(%struct.B* nonnull %LastSearch.i.i)
+ %tobool.i.i = icmp eq %"struct.J<K::L, false, int>::Node"* %call.i.i, null
+ br i1 %tobool.i.i, label %_ZN1NIN1K1LELi0EE11getOrInsertIiEE1AIPS1_ET_.exit.i, label %if.then.i.i
+
+if.then.i.i:
+ %2 = lshr i64 %call, 32
+ %3 = trunc i64 %2 to i32
+ %Payload.i.i = getelementptr inbounds %"struct.J<K::L, false, int>::Node", %"struct.J<K::L, false, int>::Node"* %call.i.i, i32 0, i32 0
+ br label %_ZN1NIN1K1LELi0EE11getOrInsertIiEE1AIPS1_ET_.exit.i
+
+_ZN1NIN1K1LELi0EE11getOrInsertIiEE1AIPS1_ET_.exit.i: ; preds = %if.then.i.i, %entry
+ %retval.sroa.0.0.i.i = phi %"class.K::L"* [ %Payload.i.i, %if.then.i.i ], [ undef, %entry ]
+ %call4.i = call %"struct.K::M"* @_ZN1FIN1K1MEE3getEv(%struct.F* undef)
+ call void @llvm.dbg.value(metadata %"struct.K::M"* %call4.i, i64 0, metadata !7, metadata !11), !dbg !12
+ call void @llvm.dbg.value(metadata %"struct.K::M"* %call4.i, i64 0, metadata !7, metadata !18), !dbg !12
+ %Handle2.i.i.i.i.i = getelementptr inbounds %"struct.K::M", %"struct.K::M"* %call4.i, i32 0, i32 0, i32 0
+ %Handle.i.i.i.i.i = getelementptr inbounds %"struct.K::M", %"struct.K::M"* %call4.i, i32 0, i32 1, i32 0
+ %4 = getelementptr inbounds %"class.K::L", %"class.K::L"* %retval.sroa.0.0.i.i, i32 0, i32 0, i32 0
+ br label %while.body.i.i.i.i
+
+while.body.i.i.i.i:
+ %5 = load i32, i32* %4, align 4
+ %call.i.i.i.i.i.i = call i32 @_Z6get_idv(), !dbg !12
+ %call.i.i.i.i.i.i.i = call zeroext i1 @_Z24__libcpp_thread_id_equalii(i32 %5, i32 %call.i.i.i.i.i.i)
+ %6 = load i32, i32* %Handle2.i.i.i.i.i, align 4
+ call void @_ZN23ConditionPlatformHelper4waitERii(i32* nonnull dereferenceable(4) %Handle.i.i.i.i.i, i32 %6)
+ br label %while.body.i.i.i.i
+}
+
+declare i64 @_Z8getCacheP23ConditionPlatformHelper(%struct.ConditionPlatformHelper*) local_unnamed_addr
+
+declare %"struct.K::M"* @_ZN1FIN1K1MEE3getEv(%struct.F*) local_unnamed_addr
+
+declare %"struct.J<K::L, false, int>::Node"* @_ZN1BIPN1JIN1K1LELb0EiE4NodeEE4loadEv(%struct.B*) local_unnamed_addr
+
+declare i32 @_Z6get_idv() local_unnamed_addr
+
+declare zeroext i1 @_Z24__libcpp_thread_id_equalii(i32, i32) local_unnamed_addr
+
+declare void @_ZN23ConditionPlatformHelper4waitERii(i32* dereferenceable(4), i32) local_unnamed_addr
+
+; Function Attrs: nounwind readnone
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
+
+attributes #0 = { nounwind "no-frame-pointer-elim-non-leaf" }
+attributes #1 = { nounwind readnone }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "test.ii", directory: "/")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 2}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = distinct !DISubprogram(name: "swift_getGenericMetadata_arguments", linkageName: "_Z34swift_getGenericMetadata_argumentsv", scope: !0, file: !1, line: 95, type: !6, isLocal: false, isDefinition: true, scopeLine: 95, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
+!6 = !DISubroutineType(types: !2)
+!7 = !DILocalVariable(name: "criticalSection", arg: 2, scope: !8, file: !1, line: 23, type: !10)
+!8 = distinct !DISubprogram(name: "<(lambda at test.ii:28:14)>", scope: !0, file: !1, line: 23, type: !6, isLocal: false, isDefinition: true, scopeLine: 23, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !2, declaration: !9, variables: !2)
+!9 = !DISubprogram(name: "<(lambda at test.ii:28:14)>", scope: !0, file: !1, line: 23, type: !6, isLocal: false, isDefinition: false, scopeLine: 23, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true, templateParams: !2)
+!10 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !0, file: !1, line: 28, size: 96, elements: !2)
+!11 = !DIExpression(DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32)
+!12 = !DILocation(line: 23, column: 33, scope: !8, inlinedAt: !13)
+!13 = distinct !DILocation(line: 28, column: 5, scope: !14, inlinedAt: !16)
+!14 = distinct !DISubprogram(name: "<(lambda at test.ii:87:58)>", scope: !0, file: !1, line: 27, type: !6, isLocal: false, isDefinition: true, scopeLine: 27, flags: DIFlagPrototyped, isOptimized: true, unit: !0, templateParams: !2, declaration: !15, variables: !2)
+!15 = !DISubprogram(name: "<(lambda at test.ii:87:58)>", scope: !0, file: !1, line: 27, type: !6, isLocal: false, isDefinition: false, scopeLine: 27, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: true, templateParams: !2)
+!16 = distinct !DILocation(line: 99, column: 21, scope: !17)
+!17 = !DILexicalBlockFile(scope: !5, file: !1, discriminator: 2)
+!18 = !DIExpression(DW_OP_plus, 4, DW_OP_stack_value, DW_OP_LLVM_fragment, 64, 32)
diff --git a/test/DebugInfo/X86/this-stack_value.ll b/test/DebugInfo/X86/this-stack_value.ll
new file mode 100644
index 0000000000000..c292b67543d13
--- /dev/null
+++ b/test/DebugInfo/X86/this-stack_value.ll
@@ -0,0 +1,123 @@
+; RUN: llc -filetype=asm -o - %s | FileCheck %s --check-prefix=ASM
+; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump - | FileCheck %s
+;
+; Generated at -O2 from:
+; struct B;
+; class A {
+; int a1 = 23;
+; int a2 = 42;
+; };
+; struct B {
+; A a;
+; int b = 48;
+; };
+;
+; B *getB() { return new B(); }
+;
+; The inlined A::this pointer has the same location as B::this, but it may not be
+; modified by the debugger.
+;
+; ASM: [DW_OP_stack_value]
+; CHECK: Location description: 70 00 9f
+; rax+0, stack-value
+source_filename = "ab.cpp"
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-apple-macosx10.12.0"
+
+%struct.B = type { %class.A, i32 }
+%class.A = type { i32, i32 }
+
+; Function Attrs: ssp uwtable
+define noalias nonnull %struct.B* @_Z4getBv() local_unnamed_addr #0 !dbg !7 {
+entry:
+ %call = tail call i8* @_Znwm(i64 12) #3, !dbg !20
+ %0 = bitcast i8* %call to %struct.B*, !dbg !20
+ tail call void @llvm.dbg.value(metadata %struct.B* %0, i64 0, metadata !21, metadata !28), !dbg !29
+ tail call void @llvm.dbg.value(metadata %struct.B* %0, i64 0, metadata !31, metadata !28), !dbg !34
+ tail call void @llvm.dbg.value(metadata %struct.B* %0, i64 0, metadata !36, metadata !44), !dbg !45
+ tail call void @llvm.dbg.value(metadata %struct.B* %0, i64 0, metadata !47, metadata !44), !dbg !50
+ %a1.i.i.i.i = bitcast i8* %call to i32*, !dbg !52
+ store i32 23, i32* %a1.i.i.i.i, align 4, !dbg !52, !tbaa !53
+ %a2.i.i.i.i = getelementptr inbounds i8, i8* %call, i64 4, !dbg !58
+ %1 = bitcast i8* %a2.i.i.i.i to i32*, !dbg !58
+ store i32 42, i32* %1, align 4, !dbg !58, !tbaa !59
+ %b.i.i = getelementptr inbounds i8, i8* %call, i64 8, !dbg !60
+ %2 = bitcast i8* %b.i.i to i32*, !dbg !60
+ store i32 48, i32* %2, align 4, !dbg !60, !tbaa !61
+ ret %struct.B* %0, !dbg !63
+}
+
+declare noalias nonnull i8* @_Znwm(i64) local_unnamed_addr #1
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
+
+attributes #0 = { ssp uwtable }
+attributes #1 = { nobuiltin }
+attributes #2 = { nounwind readnone }
+attributes #3 = { builtin }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 301093) (llvm/trunk 301093)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "ab.cpp", directory: "/")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"PIC Level", i32 2}
+!7 = distinct !DISubprogram(name: "getB", linkageName: "_Z4getBv", scope: !1, file: !1, line: 11, type: !8, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{!10}
+!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
+!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !1, line: 6, size: 96, elements: !12, identifier: "_ZTS1B")
+!12 = !{!13, !19}
+!13 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !11, file: !1, line: 7, baseType: !14, size: 64)
+!14 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !1, line: 2, size: 64, elements: !15, identifier: "_ZTS1A")
+!15 = !{!16, !18}
+!16 = !DIDerivedType(tag: DW_TAG_member, name: "a1", scope: !14, file: !1, line: 3, baseType: !17, size: 32)
+!17 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!18 = !DIDerivedType(tag: DW_TAG_member, name: "a2", scope: !14, file: !1, line: 4, baseType: !17, size: 32, offset: 32)
+!19 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !11, file: !1, line: 8, baseType: !17, size: 32, offset: 64)
+!20 = !DILocation(line: 11, column: 20, scope: !7)
+!21 = !DILocalVariable(name: "this", arg: 1, scope: !22, type: !10, flags: DIFlagArtificial | DIFlagObjectPointer)
+!22 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", scope: !11, file: !1, line: 6, type: !23, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !26, variables: !27)
+!23 = !DISubroutineType(types: !24)
+!24 = !{null, !25}
+!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!26 = !DISubprogram(name: "B", scope: !11, type: !23, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: true)
+!27 = !{!21}
+!28 = !DIExpression()
+!29 = !DILocation(line: 0, scope: !22, inlinedAt: !30)
+!30 = distinct !DILocation(line: 11, column: 24, scope: !7)
+!31 = !DILocalVariable(name: "this", arg: 1, scope: !32, type: !10, flags: DIFlagArtificial | DIFlagObjectPointer)
+!32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", scope: !11, file: !1, line: 6, type: !23, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !26, variables: !33)
+!33 = !{!31}
+!34 = !DILocation(line: 0, scope: !32, inlinedAt: !35)
+!35 = distinct !DILocation(line: 6, column: 8, scope: !22, inlinedAt: !30)
+!36 = !DILocalVariable(name: "this", arg: 1, scope: !37, type: !43, flags: DIFlagArtificial | DIFlagObjectPointer)
+!37 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC1Ev", scope: !14, file: !1, line: 2, type: !38, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !41, variables: !42)
+!38 = !DISubroutineType(types: !39)
+!39 = !{null, !40}
+!40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!41 = !DISubprogram(name: "A", scope: !14, type: !38, isLocal: false, isDefinition: false, flags: DIFlagPublic | DIFlagArtificial | DIFlagPrototyped, isOptimized: true)
+!42 = !{!36}
+!43 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !14, size: 64)
+!44 = !DIExpression(DW_OP_stack_value)
+!45 = !DILocation(line: 0, scope: !37, inlinedAt: !46)
+!46 = distinct !DILocation(line: 6, column: 8, scope: !32, inlinedAt: !35)
+!47 = !DILocalVariable(name: "this", arg: 1, scope: !48, type: !43, flags: DIFlagArtificial | DIFlagObjectPointer)
+!48 = distinct !DISubprogram(name: "A", linkageName: "_ZN1AC2Ev", scope: !14, file: !1, line: 2, type: !38, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: true, unit: !0, declaration: !41, variables: !49)
+!49 = !{!47}
+!50 = !DILocation(line: 0, scope: !48, inlinedAt: !51)
+!51 = distinct !DILocation(line: 2, column: 7, scope: !37, inlinedAt: !46)
+!52 = !DILocation(line: 3, column: 7, scope: !48, inlinedAt: !51)
+!53 = !{!54, !55, i64 0}
+!54 = !{!"_ZTS1A", !55, i64 0, !55, i64 4}
+!55 = !{!"int", !56, i64 0}
+!56 = !{!"omnipotent char", !57, i64 0}
+!57 = !{!"Simple C++ TBAA"}
+!58 = !DILocation(line: 4, column: 7, scope: !48, inlinedAt: !51)
+!59 = !{!54, !55, i64 4}
+!60 = !DILocation(line: 8, column: 7, scope: !32, inlinedAt: !35)
+!61 = !{!62, !55, i64 8}
+!62 = !{!"_ZTS1B", !54, i64 0, !55, i64 8}
+!63 = !DILocation(line: 11, column: 13, scope: !7)
diff --git a/test/DebugInfo/X86/tls.ll b/test/DebugInfo/X86/tls.ll
index b6ea213dd7481..78b45e568a737 100644
--- a/test/DebugInfo/X86/tls.ll
+++ b/test/DebugInfo/X86/tls.ll
@@ -4,7 +4,7 @@
; RUN: llc %s -o - -filetype=asm -O0 -mtriple=i386-linux-gnu \
; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=SINGLE --check-prefix=SINGLE-32 --check-prefix=GNUOP %s
-; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-unknown-linux-gnu -split-dwarf=Enable \
+; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-unknown-linux-gnu -split-dwarf-file=foo.dwo \
; RUN: | FileCheck --check-prefix=NOEMU --check-prefix=FISSION --check-prefix=GNUOP %s
; RUN: llc %s -o - -filetype=asm -O0 -mtriple=x86_64-scei-ps4 \
diff --git a/test/DebugInfo/X86/type_units_with_addresses.ll b/test/DebugInfo/X86/type_units_with_addresses.ll
index 4816ce3ac69fa..e93ed699ac547 100644
--- a/test/DebugInfo/X86/type_units_with_addresses.ll
+++ b/test/DebugInfo/X86/type_units_with_addresses.ll
@@ -1,9 +1,9 @@
; REQUIRES: object-emission
-; RUN: llc -split-dwarf=Enable -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu < %s \
+; RUN: llc -split-dwarf-file=foo.dwo -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu < %s \
; RUN: | llvm-dwarfdump - | FileCheck %s
-; RUN: llc -split-dwarf=Disable -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu < %s \
+; RUN: llc -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu < %s \
; RUN: | llvm-dwarfdump - | FileCheck --check-prefix=SINGLE %s
; Test case built from:
diff --git a/test/DebugInfo/X86/vla.ll b/test/DebugInfo/X86/vla.ll
index 1c72519ccb8d2..17f1c48b6ebb7 100644
--- a/test/DebugInfo/X86/vla.ll
+++ b/test/DebugInfo/X86/vla.ll
@@ -1,6 +1,6 @@
; RUN: llc -O0 -mtriple=x86_64-apple-darwin -filetype=asm %s -o - | FileCheck %s
; Ensure that we generate an indirect location for the variable length array a.
-; CHECK: ##DEBUG_VALUE: vla:a <- [%RCX+0]
+; CHECK: ##DEBUG_VALUE: vla:a <- [DW_OP_deref] [%RCX+0]
; CHECK: DW_OP_breg2
; rdar://problem/13658587
;