|
| 1 | +# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass wasm-reg-stackify %s -o - | FileCheck %s |
| 2 | + |
| 3 | +--- | |
| 4 | + target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" |
| 5 | + target triple = "wasm32-unknown-unknown" |
| 6 | + |
| 7 | + define void @dbg_value_list_test() { |
| 8 | + ret void |
| 9 | + } |
| 10 | + |
| 11 | + !llvm.module.flags = !{!0} |
| 12 | + !llvm.dbg.cu = !{!1} |
| 13 | + |
| 14 | + !0 = !{i32 2, !"Debug Info Version", i32 3} |
| 15 | + !1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.9.0 (trunk 266005) (llvm/trunk 266105)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !3) |
| 16 | + !2 = !DIFile(filename: "test.c", directory: "/") |
| 17 | + !3 = !{} |
| 18 | + !4 = distinct !DISubprogram(name: "dbg_value_list_test", scope: !2, file: !2, line: 10, type: !5, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, unit: !1, retainedNodes: !3) |
| 19 | + !5 = !DISubroutineType(types: !3) |
| 20 | + !6 = !DILocalVariable(name: "var", scope: !4, file: !2, line: 15, type: !7) |
| 21 | + !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 22 | + !8 = !DILocation(line: 15, column: 6, scope: !4) |
| 23 | +... |
| 24 | + |
| 25 | +# WebAssemblyDebugValueManager currently does not handle DBG_VALUE_LIST |
| 26 | +# instructions correctly and instead effectively nullifying them by turning them |
| 27 | +# into "DBG_VALUE $noreg". See https://bugs.llvm.org/show_bug.cgi?id=50361. |
| 28 | +# (Otherwise DBG_VALUE_LIST instructions can be exponentially and possibly |
| 29 | +# incorrectly copied.) |
| 30 | +# This tests if DBG_VALUE_LIST is nullified as intended. |
| 31 | + |
| 32 | +# CHECK-LABEL: name: dbg_value_list_test |
| 33 | +name: dbg_value_list_test |
| 34 | +liveins: |
| 35 | + - { reg: '$arguments' } |
| 36 | +body: | |
| 37 | + bb.0: |
| 38 | + ; CHECK: DBG_VALUE $noreg, $noreg |
| 39 | + %0:i32 = ARGUMENT_i32 0, implicit $arguments |
| 40 | + %1:i32 = ARGUMENT_i32 1, implicit $arguments |
| 41 | + %2:i32 = ARGUMENT_i32 2, implicit $arguments |
| 42 | + %3:i32 = LOAD_I32_A32 2, 0, %0:i32, implicit-def dead $arguments |
| 43 | + %4:i32 = LT_U_I32 %3:i32, %1:i32, implicit-def dead $arguments |
| 44 | + %5:i32 = GE_U_I32 %4:i32, %2:i32, implicit-def dead $arguments |
| 45 | + %6:i32 = OR_I32 %5:i32, %4:i32, implicit-def dead $arguments |
| 46 | + ; This should become "DBG_VALUE $noreg" and should not be copied when %4 is |
| 47 | + ; tee'd |
| 48 | + ; CHECK-NOT: DBG_VALUE_LIST |
| 49 | + DBG_VALUE_LIST !6, !DIExpression(), %4:i32, debug-location !8 |
| 50 | + RETURN %6:i32, implicit-def dead $arguments |
| 51 | +... |
0 commit comments