1 ; RUN: llc %s -stop-before wasm-nullify-dbg-value-lists -o - | FileCheck %s --check-prefix=BEFORE
2 ; RUN: llc %s -stop-after wasm-nullify-dbg-value-lists -o - | FileCheck %s --check-prefix=AFTER
4 target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
5 target triple = "wasm32-unknown-unknown"
7 ; WebAssembly backend does not currently handle DBG_VALUE_LIST instructions
8 ; correctly. In the meantime, they are converted to undefs in
9 ; WebAssemblyNullifyDebugValueLists pass.
11 ; BEFORE: DBG_VALUE_LIST !{{[0-9]+}}, !DIExpression(), %{{[0-9]+}}, %{{[0-9]+}}
12 ; AFTER: DBG_VALUE_LIST !{{[0-9]+}}, !DIExpression(), $noreg, $noreg
13 define i32 @dbg_value_list_test() !dbg !6 {
15 %0 = call i32 @foo(), !dbg !9
16 %1 = call i32 @foo(), !dbg !10
17 %2 = add i32 %0, %1, !dbg !11
18 ; This DIArgList operand generates a DBG_VALUE_LIST instruction
19 call void @llvm.dbg.value(metadata !DIArgList(i32 %0, i32 %1), metadata !8, metadata !DIExpression()), !dbg !11
24 declare void @llvm.dbg.value(metadata, metadata, metadata)
27 !llvm.module.flags = !{!3, !4, !5}
29 !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git ed7aaf832444411ce93aa0443425ce401f5c7a8e)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
30 !1 = !DIFile(filename: "test.c", directory: "/home/llvm-project")
31 !2 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
32 !3 = !{i32 7, !"Dwarf Version", i32 4}
33 !4 = !{i32 2, !"Debug Info Version", i32 3}
34 !5 = !{i32 1, !"wchar_size", i32 4}
35 !6 = distinct !DISubprogram(name: "", scope: !1, file: !1, line: 3, type: !7, scopeLine: 3, flags: DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0)
36 !7 = !DISubroutineType(types: !{null})
37 !8 = !DILocalVariable(name: "i", scope: !6, file: !1, line: 4, type: !2)
38 !9 = !DILocation(line: 4, column: 11, scope: !6)
39 !10 = !DILocation(line: 5, column: 11, scope: !6)
40 !11 = !DILocation(line: 6, column: 3, scope: !6)
41 !12 = !DILocation(line: 7, column: 1, scope: !6)