callsite-attr-invalid.ll 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ; RUN: opt -verify < %s 2>&1 | FileCheck %s
  2. ; CHECK: DIFlagAllCallsDescribed must be attached to a definition
  3. ; CHECK: warning: ignoring invalid debug info
  4. ; Source:
  5. ; struct A { ~A(); };
  6. ; void foo() { A x; }
  7. %struct.A = type { i8 }
  8. define void @_Z3foov() !dbg !8 {
  9. entry:
  10. %x = alloca %struct.A, align 1
  11. call void @llvm.dbg.declare(metadata %struct.A* %x, metadata !12, metadata !DIExpression()), !dbg !19
  12. call void @_ZN1AD1Ev(%struct.A* %x) #3, !dbg !20
  13. ret void, !dbg !20
  14. }
  15. declare void @llvm.dbg.declare(metadata, metadata, metadata)
  16. declare void @_ZN1AD1Ev(%struct.A*)
  17. !llvm.dbg.cu = !{!0}
  18. !llvm.module.flags = !{!3, !4, !5, !6}
  19. !llvm.ident = !{!7}
  20. !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
  21. !1 = !DIFile(filename: "-", directory: "/Users/vsk/src/builds/llvm-project-tailcall-RA")
  22. !2 = !{}
  23. !3 = !{i32 2, !"Dwarf Version", i32 4}
  24. !4 = !{i32 2, !"Debug Info Version", i32 3}
  25. !5 = !{i32 1, !"wchar_size", i32 4}
  26. !6 = !{i32 7, !"PIC Level", i32 2}
  27. !7 = !{!"clang version 8.0.0 "}
  28. !8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !9, file: !9, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
  29. !9 = !DIFile(filename: "<stdin>", directory: "/Users/vsk/src/builds/llvm-project-tailcall-RA")
  30. !10 = !DISubroutineType(types: !11)
  31. !11 = !{null}
  32. !12 = !DILocalVariable(name: "x", scope: !8, file: !9, line: 1, type: !13)
  33. !13 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !9, line: 1, size: 8, flags: DIFlagTypePassByReference, elements: !14, identifier: "_ZTS1A")
  34. !14 = !{!15}
  35. !15 = !DISubprogram(name: "~A", scope: !13, file: !9, line: 1, type: !16, isLocal: false, isDefinition: false, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, isOptimized: false)
  36. !16 = !DISubroutineType(types: !17)
  37. !17 = !{null, !18}
  38. !18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
  39. !19 = !DILocation(line: 1, column: 36, scope: !8)
  40. !20 = !DILocation(line: 1, column: 39, scope: !8)