Vedant Kumar | b9c1a23 | 2018-06-26 22:46:41 +0000 | [diff] [blame^] | 1 | ; RUN: opt -check-debugify < %s 2>&1 | FileCheck %s |
| 2 | |
| 3 | define <2 x i64> @test-fun(<2 x i64> %A) !dbg !6 { |
| 4 | %and = and <2 x i64> %A, <i64 23, i64 42>, !dbg !14 |
| 5 | |
| 6 | ; CHECK: ERROR: dbg.value operand has size 128, but its variable has size 256 |
| 7 | call void @llvm.dbg.value(metadata <2 x i64> %and, metadata !12, metadata !DIExpression()), !dbg !15 |
| 8 | |
| 9 | ; CHECK: ERROR: dbg.value operand has size 512, but its variable has size 256 |
| 10 | call void @llvm.dbg.value(metadata <2 x i256> zeroinitializer, metadata !12, metadata !DIExpression()), !dbg !15 |
| 11 | |
| 12 | ; CHECK: ERROR: dbg.value operand has size 8, but its variable has size 256 |
| 13 | call void @llvm.dbg.value(metadata i8 0, metadata !12, metadata !DIExpression()), !dbg !15 |
| 14 | |
| 15 | ; Assume the debugger implicitly uses the lower 256 bits. |
| 16 | ; CHECK-NOT: ERROR: dbg.value operand has size 512, but its variable has size 256 |
| 17 | call void @llvm.dbg.value(metadata i512 0, metadata !12, metadata !DIExpression()), !dbg !15 |
| 18 | |
| 19 | ret <2 x i64> %and, !dbg !16 |
| 20 | } |
| 21 | ; CHECK: CheckModuleDebugify: FAIL |
| 22 | |
| 23 | ; Function Attrs: nounwind readnone speculatable |
| 24 | declare void @llvm.dbg.value(metadata, metadata, metadata) #0 |
| 25 | |
| 26 | attributes #0 = { nounwind readnone speculatable } |
| 27 | |
| 28 | !llvm.dbg.cu = !{!0} |
| 29 | !llvm.debugify = !{!3, !4} |
| 30 | !llvm.module.flags = !{!5} |
| 31 | |
| 32 | !0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2) |
| 33 | !1 = !DIFile(filename: "/Users/vsk/src/llvm.org-master/llvm/test/DebugInfo/debugify-bogus-dbg-value.ll", directory: "/") |
| 34 | !2 = !{} |
| 35 | !3 = !{i32 4} |
| 36 | !4 = !{i32 3} |
| 37 | !5 = !{i32 2, !"Debug Info Version", i32 3} |
| 38 | !6 = distinct !DISubprogram(name: "test-fun", linkageName: "test-fun", scope: null, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: true, unit: !0, retainedNodes: !8) |
| 39 | !7 = !DISubroutineType(types: !2) |
| 40 | !8 = !{!9, !11, !12} |
| 41 | !9 = !DILocalVariable(name: "1", scope: !6, file: !1, line: 1, type: !10) |
| 42 | !10 = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned) |
| 43 | !11 = !DILocalVariable(name: "2", scope: !6, file: !1, line: 2, type: !10) |
| 44 | !12 = !DILocalVariable(name: "3", scope: !6, file: !1, line: 3, type: !13) |
| 45 | |
| 46 | ; Set the size here to an incorrect value to check that the size diagnostic |
| 47 | ; triggers. |
| 48 | !13 = !DIBasicType(name: "ty128", size: 256, encoding: DW_ATE_unsigned) |
| 49 | |
| 50 | !14 = !DILocation(line: 2, column: 1, scope: !6) |
| 51 | !15 = !DILocation(line: 3, column: 1, scope: !6) |
| 52 | !16 = !DILocation(line: 4, column: 1, scope: !6) |