xref: /llvm-project/llvm/test/DebugInfo/Generic/export-symbol-anonymous-class.ll (revision 5336b1ed755627892129454a9d9351463503bb82)
1; XFAIL: target={{.*}}-aix{{.*}}
2; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
3;
4; struct A {
5;  // Anonymous class exports its symbols into A
6;  struct {
7;      int y;
8;  };
9; } a;
10;
11; CHECK: DW_TAG_structure_type
12; CHECK-NEXT: DW_AT_calling_convention	(DW_CC_pass_by_value)
13; CHECK-NEXT: DW_AT_name	("A")
14;
15; CHECK-NOT: NULL
16;
17; CHECK: DW_TAG_structure_type
18; CHECK-NEXT: DW_AT_export_symbols	(true)
19
20%struct.A = type { %struct.anon }
21%struct.anon = type { i32 }
22
23@a = global %struct.A zeroinitializer, align 4, !dbg !0
24
25!llvm.module.flags = !{!14, !15}
26!llvm.dbg.cu = !{!2}
27!llvm.ident = !{!16}
28
29!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
30!1 = distinct !DIGlobalVariable(name: "a", scope: !2, file: !3, line: 5, type: !6, isLocal: false, isDefinition: true)
31!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 10.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: GNU)
32!3 = !DIFile(filename: "simple_anon_class.cpp", directory: "/dir")
33!4 = !{}
34!5 = !{!0}
35!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !3, line: 1, size: 32, flags: DIFlagTypePassByValue, elements: !7, identifier: "_ZTS1A")
36!7 = !{!8}
37!8 = !DIDerivedType(tag: DW_TAG_member, scope: !6, file: !3, line: 2, baseType: !9, size: 32)
38!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !6, file: !3, line: 2, size: 32, flags: DIFlagExportSymbols | DIFlagTypePassByValue, elements: !10, identifier: "_ZTSN1AUt_E")
39!10 = !{!11}
40!11 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !9, file: !3, line: 3, baseType: !12, size: 32)
41!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
42!14 = !{i32 2, !"Dwarf Version", i32 4}
43!15 = !{i32 2, !"Debug Info Version", i32 3}
44!16 = !{!"clang version 10.0.0"}
45