11;; Roundtrip tests.
2- ; RUN: llvm-as --write-experimental-debuginfo-iterators-to-bitcode=true %s -o - | llvm-dis | FileCheck %s
2+
3+ ;; Load RemoveDIs mode in llvm-dis but write out debug intrinsics.
4+ ; RUN: llvm-as --write-experimental-debuginfo-iterators-to-bitcode=true %s -o - \
5+ ; RUN: | llvm-dis --load-bitcode-into-experimental-debuginfo-iterators=true --write-experimental-debuginfo=false \
6+ ; RUN: | FileCheck %s
7+
8+ ;; Load and write RemoveDIs mode in llvm-dis.
9+ ; RUN: llvm-as --write-experimental-debuginfo-iterators-to-bitcode=true %s -o - \
10+ ; RUN: | llvm-dis --load-bitcode-into-experimental-debuginfo-iterators=true --write-experimental-debuginfo=true \
11+ ; RUN: | FileCheck %s --check-prefixes=RECORDS
12+
313;; Check that verify-uselistorder passes regardless of input format.
414; RUN: llvm-as %s --write-experimental-debuginfo-iterators-to-bitcode=true -o - | verify-uselistorder
515; RUN: verify-uselistorder %s
@@ -39,16 +49,24 @@ entry:
3949; CHECK-NEXT: dbg.value(metadata ![[empty:[0-9]+]], metadata ![[e]], metadata !DIExpression()), !dbg ![[dbg]]
4050; CHECK-NEXT: dbg.value(metadata i32 poison, metadata ![[e]], metadata !DIExpression()), !dbg ![[dbg]]
4151; CHECK-NEXT: dbg.value(metadata i32 1, metadata ![[f:[0-9]+]], metadata !DIExpression()), !dbg ![[dbg]]
52+ ; RECORDS: entry:
53+ ; RECORDS-NEXT: dbg_value(i32 %p, ![[e:[0-9]+]], !DIExpression(), ![[dbg:[0-9]+]])
54+ ; RECORDS-NEXT: dbg_value(![[empty:[0-9]+]], ![[e]], !DIExpression(), ![[dbg]])
55+ ; RECORDS-NEXT: dbg_value(i32 poison, ![[e]], !DIExpression(), ![[dbg]])
56+ ; RECORDS-NEXT: dbg_value(i32 1, ![[f:[0-9]+]], !DIExpression(), ![[dbg]])
4257 tail call void @llvm.dbg.value (metadata i32 %p , metadata !32 , metadata !DIExpression ()), !dbg !19
4358 tail call void @llvm.dbg.value (metadata !29 , metadata !32 , metadata !DIExpression ()), !dbg !19
4459 tail call void @llvm.dbg.value (metadata i32 poison, metadata !32 , metadata !DIExpression ()), !dbg !19
4560 tail call void @llvm.dbg.value (metadata i32 1 , metadata !33 , metadata !DIExpression ()), !dbg !19
4661;; Arglist with an argument, constant, local use before def, poison.
4762; CHECK-NEXT: dbg.value(metadata !DIArgList(i32 %p, i32 0, i32 %0, i32 poison), metadata ![[f]], metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_LLVM_arg, 2, DW_OP_LLVM_arg, 3, DW_OP_plus, DW_OP_minus)), !dbg ![[dbg]]
63+ ; RECORDS-NEXT: dbg_value(!DIArgList(i32 %p, i32 0, i32 %0, i32 poison), ![[f]], !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_LLVM_arg, 2, DW_OP_LLVM_arg, 3, DW_OP_plus, DW_OP_minus), ![[dbg]])
4864 tail call void @llvm.dbg.value (metadata !DIArgList (i32 %p , i32 0 , i32 %0 , i32 poison), metadata !33 , metadata !DIExpression (DW_OP_LLVM_arg, 0 , DW_OP_LLVM_arg, 1 , DW_OP_plus, DW_OP_LLVM_arg, 2 , DW_OP_LLVM_arg, 3 , DW_OP_plus, DW_OP_minus)), !dbg !19
4965;; Check dbg.assign use before def (value, addr and ID). Check expression order too.
5066; CHECK: dbg.assign(metadata i32 %0, metadata ![[i:[0-9]+]], metadata !DIExpression(DW_OP_plus_uconst, 0),
5167; CHECK-SAME: metadata ![[ID:[0-9]+]], metadata ptr %a, metadata !DIExpression(DW_OP_plus_uconst, 1)), !dbg ![[dbg]]
68+ ; RECORDS: dbg_assign(i32 %0, ![[i:[0-9]+]], !DIExpression(DW_OP_plus_uconst, 0),
69+ ; RECORDS-SAME: ![[ID:[0-9]+]], ptr %a, !DIExpression(DW_OP_plus_uconst, 1), ![[dbg]])
5270 tail call void @llvm.dbg.assign (metadata i32 %0 , metadata !36 , metadata !DIExpression (DW_OP_plus_uconst, 0 ), metadata !37 , metadata ptr %a , metadata !DIExpression (DW_OP_plus_uconst, 1 )), !dbg !19
5371 %a = alloca i32 , align 4 , !DIAssignID !37
5472; CHECK: %a = alloca i32, align 4, !DIAssignID ![[ID]]
@@ -58,24 +76,35 @@ entry:
5876; CHECK-NEXT: dbg.declare(metadata ptr poison, metadata ![[c:[0-9]+]], metadata !DIExpression()), !dbg ![[dbg]]
5977; CHECK-NEXT: dbg.declare(metadata ptr null, metadata ![[d:[0-9]+]], metadata !DIExpression()), !dbg ![[dbg]]
6078; CHECK-NEXT: dbg.declare(metadata ptr @g, metadata ![[h:[0-9]+]], metadata !DIExpression()), !dbg ![[dbg]]
79+ ; RECORDS: %a = alloca i32, align 4, !DIAssignID ![[ID]]
80+ ;; Check dbg.declare configurations.
81+ ; RECORDS-NEXT: dbg_declare(ptr %a, ![[a:[0-9]+]], !DIExpression(), ![[dbg]])
82+ ; RECORDS-NEXT: dbg_declare(![[empty:[0-9]+]], ![[b:[0-9]+]], !DIExpression(), ![[dbg]])
83+ ; RECORDS-NEXT: dbg_declare(ptr poison, ![[c:[0-9]+]], !DIExpression(), ![[dbg]])
84+ ; RECORDS-NEXT: dbg_declare(ptr null, ![[d:[0-9]+]], !DIExpression(), ![[dbg]])
85+ ; RECORDS-NEXT: dbg_declare(ptr @g, ![[h:[0-9]+]], !DIExpression(), ![[dbg]])
6186 tail call void @llvm.dbg.declare (metadata ptr %a , metadata !17 , metadata !DIExpression ()), !dbg !19
6287 tail call void @llvm.dbg.declare (metadata !29 , metadata !28 , metadata !DIExpression ()), !dbg !19
6388 tail call void @llvm.dbg.declare (metadata ptr poison, metadata !30 , metadata !DIExpression ()), !dbg !19
6489 tail call void @llvm.dbg.declare (metadata ptr null , metadata !31 , metadata !DIExpression ()), !dbg !19
6590 tail call void @llvm.dbg.declare (metadata ptr @g , metadata !35 , metadata !DIExpression ()), !dbg !19
6691;; Argument value dbg.declare.
6792; CHECK: dbg.declare(metadata ptr %storage, metadata ![[g:[0-9]+]], metadata !DIExpression()), !dbg ![[dbg]]
93+ ; RECORDS: dbg_declare(ptr %storage, ![[g:[0-9]+]], !DIExpression(), ![[dbg]])
6894 tail call void @llvm.dbg.declare (metadata ptr %storage , metadata !34 , metadata !DIExpression ()), !dbg !19
6995;; Use before def dbg.value.
7096; CHECK: dbg.value(metadata i32 %0, metadata ![[e]], metadata !DIExpression()), !dbg ![[dbg]]
97+ ; RECORDS: dbg_value(i32 %0, ![[e]], !DIExpression(), ![[dbg]])
7198 tail call void @llvm.dbg.value (metadata i32 %0 , metadata !32 , metadata !DIExpression ()), !dbg !19
7299 %0 = load i32 , ptr @g , align 4 , !dbg !20
73100;; Non-argument local value dbg.value.
74101; CHECK: dbg.value(metadata i32 %0, metadata ![[e]], metadata !DIExpression()), !dbg ![[dbg]]
102+ ; RECORDS: dbg_value(i32 %0, ![[e]], !DIExpression(), ![[dbg]])
75103 tail call void @llvm.dbg.value (metadata i32 %0 , metadata !32 , metadata !DIExpression ()), !dbg !19
76104 store i32 %0 , ptr %a , align 4 , !dbg !19
77105 %1 = load i32 , ptr %a , align 4 , !dbg !25
78106; CHECK: dbg.label(metadata ![[label:[0-9]+]]), !dbg ![[dbg]]
107+ ; RECORDS: dbg_label(![[label:[0-9]+]], ![[dbg]])
79108 tail call void @llvm.dbg.label (metadata !38 ), !dbg !19
80109 ret i32 %1 , !dbg !27
81110}
0 commit comments