debuginfofinder-forward-declaration.ll 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ; RUN: opt -analyze -module-debuginfo < %s | FileCheck %s
  2. ; This module is generated from the following c-code:
  3. ;
  4. ; > union X;
  5. ; >
  6. ; > struct Y {
  7. ; > union X *x;
  8. ; > };
  9. ; >
  10. ; > struct Y y;
  11. ; CHECK: Type: Y from /tmp/minimal.c:3 DW_TAG_structure_type
  12. ; CHECK: Type: x from /tmp/minimal.c:4 DW_TAG_member
  13. ; CHECK: Type: DW_TAG_pointer_type
  14. ; CHECK: Type: X from /tmp/minimal.c:1 DW_TAG_structure_type
  15. source_filename = "test/DebugInfo/Generic/debuginfofinder-forward-declaration.ll"
  16. %struct.Y = type { %struct.X* }
  17. %struct.X = type opaque
  18. @y = common global %struct.Y zeroinitializer, align 8, !dbg !0
  19. !llvm.dbg.cu = !{!2}
  20. !llvm.module.flags = !{!11, !12}
  21. !llvm.ident = !{!13}
  22. !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
  23. !1 = !DIGlobalVariable(name: "y", scope: !2, file: !3, line: 7, type: !6, isLocal: false, isDefinition: true)
  24. !2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
  25. !3 = !DIFile(filename: "minimal.c", directory: "/tmp")
  26. !4 = !{}
  27. !5 = !{!0}
  28. !6 = !DICompositeType(tag: DW_TAG_structure_type, name: "Y", file: !3, line: 3, size: 64, align: 64, elements: !7)
  29. !7 = !{!8}
  30. !8 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !6, file: !3, line: 4, baseType: !9, size: 64, align: 64)
  31. !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64, align: 64)
  32. !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", file: !3, line: 1, flags: DIFlagFwdDecl)
  33. !11 = !{i32 2, !"Dwarf Version", i32 4}
  34. !12 = !{i32 2, !"Debug Info Version", i32 3}
  35. !13 = !{!"clang version 3.7.0"}