[llvm] r233349 - DebugInfo: Update testcases with invalid variables

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Mar 26 18:58:34 PDT 2015


Author: dexonsmith
Date: Thu Mar 26 20:58:34 2015
New Revision: 233349

URL: http://llvm.org/viewvc/llvm-project?rev=233349&view=rev
Log:
DebugInfo: Update testcases with invalid variables

Fix testcases whose variables are invalid.  I'm working on a patch that
adds `Verifier` checks for `MDLocalVariable` (and `MDGlobalVariable`),
and these failed because:

  - `scope:` fields need to point at `MDLocalScope` and can't be null.
  - `file:` fields need to point at `MDFile`.
  - `inlinedAt:` fields need to point at `MDLocation`.

Modified:
    llvm/trunk/test/CodeGen/X86/2012-11-30-handlemove-dbg.ll
    llvm/trunk/test/CodeGen/X86/2012-11-30-misched-dbg.ll
    llvm/trunk/test/CodeGen/X86/2012-11-30-regpres-dbg.ll
    llvm/trunk/test/CodeGen/X86/StackColoring-dbg.ll
    llvm/trunk/test/DebugInfo/2009-11-10-CurrentFn.ll
    llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll
    llvm/trunk/test/Transforms/Inline/ignore-debug-info.ll
    llvm/trunk/test/Transforms/LoopRotate/dbgvalue.ll
    llvm/trunk/test/Transforms/ObjCARC/basic.ll

Modified: llvm/trunk/test/CodeGen/X86/2012-11-30-handlemove-dbg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2012-11-30-handlemove-dbg.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2012-11-30-handlemove-dbg.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2012-11-30-handlemove-dbg.ll Thu Mar 26 20:58:34 2015
@@ -5,7 +5,7 @@
 ; rdar://12777252.
 ;
 ; CHECK: %entry
-; CHECK: DEBUG_VALUE: hg
+; CHECK: DEBUG_VALUE: subdivp:hg
 ; CHECK: j
 
 %struct.node.0.27 = type { i16, double, [3 x double], i32, i32 }
@@ -40,7 +40,7 @@ declare void @llvm.dbg.value(metadata, i
 
 !0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 168918) (llvm/trunk 168920)", isOptimized: true, emissionKind: 0, file: !11, enums: !2, retainedTypes: !2, subprograms: !13, globals: !2)
 !2 = !{}
-!4 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "hg", line: 725, arg: 4, scope: null, file: !5, type: !6)
+!4 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "hg", line: 725, arg: 4, scope: !14, file: !5, type: !6)
 !5 = !MDFile(filename: "MultiSource/Benchmarks/Olden/bh/newbh.c", directory: "MultiSource/Benchmarks/Olden/bh")
 !6 = !MDDerivedType(tag: DW_TAG_typedef, name: "hgstruct", line: 492, file: !11, baseType: !7)
 !7 = !MDCompositeType(tag: DW_TAG_structure_type, line: 487, size: 512, align: 64, file: !11)

Modified: llvm/trunk/test/CodeGen/X86/2012-11-30-misched-dbg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2012-11-30-misched-dbg.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2012-11-30-misched-dbg.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2012-11-30-misched-dbg.ll Thu Mar 26 20:58:34 2015
@@ -93,7 +93,7 @@ declare i32 @__sprintf_chk(i8*, i32, i64
 ; Test DebugValue uses visited by RegisterPressureTracker findUseBetween().
 ;
 ; CHECK: @main
-; CHECK: DEBUG_VALUE: X
+; CHECK: DEBUG_VALUE: main:X
 ; CHECK: call
 
 %"class.__gnu_cxx::hash_map" = type { %"class.__gnu_cxx::hashtable" }
@@ -135,7 +135,7 @@ declare void @_Znwm()
 !llvm.dbg.cu = !{!30}
 
 !30 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169129) (llvm/trunk 169135)", isOptimized: true, emissionKind: 0, file: !34, enums: !2, retainedTypes: !2, subprograms: !36)
-!31 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "X", line: 29, scope: null, type: !32)
+!31 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "X", line: 29, scope: !37, type: !32)
 !32 = !MDDerivedType(tag: DW_TAG_typedef, name: "HM", line: 28, file: !34, baseType: null)
 !33 = !MDFile(filename: "SingleSource/Benchmarks/Shootout-C++/hash.cpp", directory: "SingleSource/Benchmarks/Shootout-C++")
 !34 = !MDFile(filename: "SingleSource/Benchmarks/Shootout-C++/hash.cpp", directory: "SingleSource/Benchmarks/Shootout-C++")

Modified: llvm/trunk/test/CodeGen/X86/2012-11-30-regpres-dbg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2012-11-30-regpres-dbg.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2012-11-30-regpres-dbg.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2012-11-30-regpres-dbg.ll Thu Mar 26 20:58:34 2015
@@ -4,7 +4,7 @@
 ; Test RegisterPressure handling of DBG_VALUE.
 ;
 ; CHECK: %entry
-; CHECK: DEBUG_VALUE: callback
+; CHECK: DEBUG_VALUE: test:callback
 ; CHECK: ret
 
 %struct.btCompoundLeafCallback = type { i32, i32 }
@@ -39,7 +39,7 @@ invoke.cont44:
 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 168984) (llvm/trunk 168983)", isOptimized: true, emissionKind: 0, file: !6, subprograms: !1)
 !1 = !{!2}
 !2 = !MDSubprogram(name: "test", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !5, type: !7, function: void ()* @test)
-!3 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "callback", line: 214, scope: null, type: !4)
+!3 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "callback", line: 214, scope: !2, type: !4)
 !4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "btCompoundLeafCallback", line: 90, size: 512, align: 64, file: !6)
 !5 = !MDFile(filename: "MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp", directory: "MultiSource/Benchmarks/Bullet")
 !6 = !MDFile(filename: "MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp", directory: "MultiSource/Benchmarks/Bullet")

Modified: llvm/trunk/test/CodeGen/X86/StackColoring-dbg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/StackColoring-dbg.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/StackColoring-dbg.ll (original)
+++ llvm/trunk/test/CodeGen/X86/StackColoring-dbg.ll Thu Mar 26 20:58:34 2015
@@ -30,6 +30,6 @@ declare void @llvm.lifetime.end(i64, i8*
 !0 = !MDCompileUnit(language: DW_LANG_C89, producer: "clang", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2)
 !1 = !MDFile(filename: "t.c", directory: "")
 !16 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
-!2 = !{i32 0}
-!22 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 16, scope: null, file: !2, type: !16)
+!2 = !MDSubprogram()
+!22 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "x", line: 16, scope: !2, file: !1, type: !16)
 !23 = !{i32 1, !"Debug Info Version", i32 3}

Modified: llvm/trunk/test/DebugInfo/2009-11-10-CurrentFn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2009-11-10-CurrentFn.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/2009-11-10-CurrentFn.ll (original)
+++ llvm/trunk/test/DebugInfo/2009-11-10-CurrentFn.ll Thu Mar 26 20:58:34 2015
@@ -21,7 +21,7 @@ declare void @llvm.dbg.value(metadata, i
 !7 = !MDSubroutineType(types: !8)
 !8 = !{null}
 !9 = !{!11}
-!11 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 3, arg: 1, scope: !17, file: !5, type: !12)
+!11 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "i", line: 3, arg: 1, scope: !5, file: !17, type: !12)
 !12 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
 !13 = !MDLocation(line: 3, column: 14, scope: !5)
 !14 = !MDLocation(line: 4, column: 3, scope: !15)

Modified: llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll (original)
+++ llvm/trunk/test/DebugInfo/2010-03-19-DbgDeclare.ll Thu Mar 26 20:58:34 2015
@@ -12,8 +12,9 @@ entry:
 !2 = !MDCompileUnit(language: DW_LANG_Mips_Assembler, producer: "clang version 3.3 ", isOptimized: false, emissionKind: 1, file: !4, enums: !3, retainedTypes: !3, subprograms: !3, globals: !3, imports:  !3)
 !3 = !{}
 !0 = !MDLocation(line: 662302, column: 26, scope: !1)
-!1 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "foo")
+!1 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "foo", scope: !6)
 !4 = !MDFile(filename: "scratch.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
+!6 = !MDSubprogram()
 
 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
 !5 = !{i32 1, !"Debug Info Version", i32 3}

Modified: llvm/trunk/test/Transforms/Inline/ignore-debug-info.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/Inline/ignore-debug-info.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/Inline/ignore-debug-info.ll (original)
+++ llvm/trunk/test/Transforms/Inline/ignore-debug-info.ll Thu Mar 26 20:58:34 2015
@@ -12,11 +12,11 @@ declare void @llvm.dbg.value(metadata, i
 
 define <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) {
 entry:
-  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
   %mul = fmul <4 x float> %a, <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>
-  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
   %mul1 = fmul <4 x float> %b, <float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00>
-  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
   %add = fadd <4 x float> %mul, %mul1
   ret <4 x float> %add
 }
@@ -27,10 +27,10 @@ define float @outer_vectors(<4 x float>
 ; CHECK: ret float
 
 entry:
-  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
-  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
+  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
   %call = call <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b)
-  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
   %vecext = extractelement <4 x float> %call, i32 0
   %vecext1 = extractelement <4 x float> %call, i32 1
   %add = fadd float %vecext, %vecext1
@@ -47,9 +47,10 @@ attributes #0 = { nounwind readnone }
 !llvm.module.flags = !{!3, !4}
 !llvm.ident = !{!5}
 
-!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !{}, globals: !2, imports: !2)
+!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !6, globals: !2, imports: !2)
 !1 = !MDFile(filename: "test.c", directory: "")
 !2 = !{}
 !3 = !{i32 2, !"Dwarf Version", i32 4}
 !4 = !{i32 1, !"Debug Info Version", i32 3}
 !5 = !{!""}
+!6 = !MDSubprogram()

Modified: llvm/trunk/test/Transforms/LoopRotate/dbgvalue.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LoopRotate/dbgvalue.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LoopRotate/dbgvalue.ll (original)
+++ llvm/trunk/test/Transforms/LoopRotate/dbgvalue.ll Thu Mar 26 20:58:34 2015
@@ -72,7 +72,7 @@ for.body:
 
 for.inc:
   %dec = add i64 %i.0, -1
-  tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !0), metadata !MDExpression())
   br label %for.cond
 
 for.end:

Modified: llvm/trunk/test/Transforms/ObjCARC/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ObjCARC/basic.ll?rev=233349&r1=233348&r2=233349&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ObjCARC/basic.ll (original)
+++ llvm/trunk/test/Transforms/ObjCARC/basic.ll Thu Mar 26 20:58:34 2015
@@ -2684,8 +2684,8 @@ define {<2 x float>, <2 x float>} @"\01-
 invoke.cont:
   %0 = bitcast {}* %self to i8*
   %1 = tail call i8* @objc_retain(i8* %0) nounwind
-  tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
-  tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable), metadata !MDExpression())
+  tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression())
+  tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression())
   %ivar = load i64, i64* @"OBJC_IVAR_$_A.myZ", align 8
   %add.ptr = getelementptr i8, i8* %0, i64 %ivar
   %tmp1 = bitcast i8* %add.ptr to float*
@@ -3018,6 +3018,7 @@ define void @test67(i8* %x) {
 
 !0 = !{}
 !1 = !{i32 1, !"Debug Info Version", i32 3}
+!2 = !MDSubprogram()
 
 ; CHECK: attributes #0 = { nounwind readnone }
 ; CHECK: attributes [[NUW]] = { nounwind }





More information about the llvm-commits mailing list