1 ; Test upgrade of dbg.addr intrinsics into dbg.value with DW_OP_deref appended
3 ; RUN: llvm-dis < %s.bc --write-experimental-debuginfo=false | FileCheck %s
4 ; RUN: llvm-dis < %s.bc --load-bitcode-into-experimental-debuginfo-iterators --write-experimental-debuginfo=false | FileCheck %s
5 ; RUN: verify-uselistorder < %s.bc
7 define i32 @example(i32 %num) {
9 %num.addr = alloca i32, align 4
10 store i32 %num, ptr %num.addr, align 4
11 ; CHECK-NOT: call void @llvm.dbg.addr
12 ; CHECK: call void @llvm.dbg.value(metadata ptr %num.addr, metadata ![[#]], metadata !DIExpression(DW_OP_deref))
13 call void @llvm.dbg.addr(metadata ptr %num.addr, metadata !16, metadata !DIExpression(DW_OP_plus_uconst, 0)), !dbg !17
14 %0 = load i32, ptr %num.addr, align 4
18 ; CHECK: declare void @llvm.dbg.value(metadata, metadata, metadata)
19 declare void @llvm.dbg.addr(metadata, metadata, metadata)
22 !llvm.module.flags = !{!2}
24 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1)
25 !1 = !DIFile(filename: "/app/example.c", directory: "/app")
26 !2 = !{i32 2, !"Debug Info Version", i32 3}
27 !10 = distinct !DISubprogram(name: "example", scope: !11, file: !11, line: 1, type: !12, scopeLine: 1, unit: !0, retainedNodes: !15)
28 !11 = !DIFile(filename: "example.c", directory: "/app")
29 !12 = !DISubroutineType(types: !13)
31 !14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
33 !16 = !DILocalVariable(name: "num", arg: 1, scope: !10, file: !11, line: 1, type: !14)
34 !17 = !DILocation(line: 1, column: 17, scope: !10)