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