xref: /llvm-project/llvm/test/DebugInfo/X86/struct-fwd-decl.ll (revision 5fe33f7399d86d5a36a8437db0661b1509200815)
1; RUN: llc -O0 -mtriple=x86_64-unknown-linux %s -o %t -filetype=obj
2; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
3; Test that size is not emitted for class declarations in DWARF, even if it exists.
4
5@s = global i16 0, align 2, !dbg !0
6
7!llvm.dbg.cu = !{!4}
8!llvm.module.flags = !{!7}
9
10!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
11!1 = !DIGlobalVariable(name: "s", scope: null, file: !2, line: 2, type: !3, isLocal: false, isDefinition: true)
12!2 = !DIFile(filename: "foo.cpp", directory: "/tmp")
13!3 = !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !2, line: 1, size: 16, align: 16, flags: DIFlagFwdDecl)
14!4 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)
15!5 = !{}
16; CHECK: DW_TAG_structure_type
17; CHECK-NEXT: DW_AT_name
18; CHECK-NOT: DW_AT_byte_size
19; CHECK: {{NULL|DW_TAG}}
20!6 = !{!0}
21!7 = !{i32 1, !"Debug Info Version", i32 3}
22