summaryrefslogtreecommitdiff
path: root/test/Bitcode
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2017-08-23 20:31:27 +0000
committerReid Kleckner <rnk@google.com>2017-08-23 20:31:27 +0000
commita5b2af0eae4529b17c52b45d6f8071bb80ede86d (patch)
tree9fc54036c76de7bbcbc00850472b314cd928cfc1 /test/Bitcode
parent35d604386eca9880ec063a79a8c124489278bd1a (diff)
Parse and print DIExpressions inline to ease IR and MIR testing
Summary: Most DIExpressions are empty or very simple. When they are complex, they tend to be unique, so checking them inline is reasonable. This also avoids the need for CodeGen passes to append to the llvm.dbg.mir named md node. See also PR22780, for making DIExpression not be an MDNode. Reviewers: aprantl, dexonsmith, dblaikie Subscribers: qcolombet, javed.absar, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D37075 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Bitcode')
-rw-r--r--test/Bitcode/DIExpression-aggresult.ll3
-rw-r--r--test/Bitcode/DIGlobalVariableExpression.ll6
-rw-r--r--test/Bitcode/diglobalvariable-3.8.ll3
-rw-r--r--test/Bitcode/upgrade-dbg-value.ll2
4 files changed, 5 insertions, 9 deletions
diff --git a/test/Bitcode/DIExpression-aggresult.ll b/test/Bitcode/DIExpression-aggresult.ll
index 5ce936d7074..27298710adb 100644
--- a/test/Bitcode/DIExpression-aggresult.ll
+++ b/test/Bitcode/DIExpression-aggresult.ll
@@ -2,8 +2,7 @@
%class.A = type { i32, i32, i32, i32 }
define void @_Z3fooi(%class.A* sret %agg.result) #0 !dbg !3 {
- ; CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[EXPR:[0-9]+]]), !dbg
- ; CHECK: ![[EXPR]] = !DIExpression()
+ ; CHECK: call void @llvm.dbg.declare({{.*}}, metadata !DIExpression()), !dbg
call void @llvm.dbg.declare(metadata %class.A* %agg.result, metadata !13, metadata !16), !dbg !17
ret void, !dbg !17
}
diff --git a/test/Bitcode/DIGlobalVariableExpression.ll b/test/Bitcode/DIGlobalVariableExpression.ll
index 3cf08247282..d6ff1390717 100644
--- a/test/Bitcode/DIGlobalVariableExpression.ll
+++ b/test/Bitcode/DIGlobalVariableExpression.ll
@@ -5,16 +5,14 @@
; BC: GLOBAL_DECL_ATTACHMENT
; CHECK: @g = common global i32 0, align 4, !dbg ![[G:[0-9]+]]
; CHECK: @h = common global i32 0, align 4, !dbg ![[H:[0-9]+]]
-; CHECK: ![[G]] = {{.*}}!DIGlobalVariableExpression(var: ![[GVAR:[0-9]+]], expr: ![[GEXPR:[0-9]+]])
+; CHECK: ![[G]] = {{.*}}!DIGlobalVariableExpression(var: ![[GVAR:[0-9]+]], expr: !DIExpression(DW_OP_plus_uconst, 1))
; CHECK: ![[GVAR]] = distinct !DIGlobalVariable(name: "g",
; CHECK: DICompileUnit({{.*}}, imports: ![[IMPORTS:[0-9]+]]
-; CHECK: !DIGlobalVariableExpression(var: ![[CVAR:[0-9]+]], expr: ![[CEXPR:[0-9]+]])
+; CHECK: !DIGlobalVariableExpression(var: ![[CVAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 23, DW_OP_stack_value))
; CHECK: ![[CVAR]] = distinct !DIGlobalVariable(name: "c",
-; CHECK: ![[CEXPR]] = !DIExpression(DW_OP_constu, 23, DW_OP_stack_value)
; CHECK: ![[HVAR:[0-9]+]] = distinct !DIGlobalVariable(name: "h",
; CHECK: ![[IMPORTS]] = !{![[CIMPORT:[0-9]+]]}
; CHECK: ![[CIMPORT]] = !DIImportedEntity({{.*}}entity: ![[HVAR]]
-; CHECK: ![[GEXPR]] = !DIExpression(DW_OP_plus_uconst, 1)
; CHECK: ![[H]] = {{.*}}!DIGlobalVariableExpression(var: ![[HVAR]])
@g = common global i32 0, align 4, !dbg !0
diff --git a/test/Bitcode/diglobalvariable-3.8.ll b/test/Bitcode/diglobalvariable-3.8.ll
index f00a2dd86f7..9a904c7aff7 100644
--- a/test/Bitcode/diglobalvariable-3.8.ll
+++ b/test/Bitcode/diglobalvariable-3.8.ll
@@ -9,9 +9,8 @@
!2 = !{}
; CHECK: !3 = !{!4}
!3 = !{!4}
-; CHECK: !4 = {{.*}}!DIGlobalVariableExpression(var: !5, expr: !8)
+; CHECK: !4 = {{.*}}!DIGlobalVariableExpression(var: !5, expr: !DIExpression(DW_OP_constu, 42, DW_OP_stack_value))
; CHECK: !5 = !DIGlobalVariable(name: "c", scope: !0, file: !1, line: 1, type: !6, isLocal: false, isDefinition: true)
-; CHECK: !8 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
!4 = !DIGlobalVariable(name: "c", scope: !0, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, variable: i32 42)
!5 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !6)
!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
diff --git a/test/Bitcode/upgrade-dbg-value.ll b/test/Bitcode/upgrade-dbg-value.ll
index 5b6ffb6d3e8..2a3a6369ae8 100644
--- a/test/Bitcode/upgrade-dbg-value.ll
+++ b/test/Bitcode/upgrade-dbg-value.ll
@@ -6,7 +6,7 @@
define void @f() !dbg !3 {
entry:
; CHECK-NOT: call void @llvm.dbg.value
- ; CHECK: call void @llvm.dbg.value(metadata i32 42, metadata !8, metadata !9), !dbg !10
+ ; CHECK: call void @llvm.dbg.value(metadata i32 42, metadata !8, metadata !DIExpression())
call void @llvm.dbg.value(metadata i32 42, i64 0, metadata !8, metadata !9), !dbg !10
; CHECK-NOT: call void @llvm.dbg.value
call void @llvm.dbg.value(metadata i32 0, i64 1, metadata !8, metadata !9), !dbg !10