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