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