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