62 lines · plain
1; RUN: %llc_dwarf -O0 -filetype=obj < %s > %t2; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s3 4; Check for a univariant discriminated union -- that is, a variant5; part without a discriminant and with just a single variant.6 7; CHECK: DW_TAG_variant_part8; CHECK-NOT: DW_AT_discr9; CHECK: DW_TAG_variant10; CHECK: DW_TAG_member11; CHECK: DW_AT_type12; CHECK: DW_AT_alignment13; CHECK: DW_AT_data_member_location [DW_FORM_data1] (0x00)14 15%F = type { [0 x i8], ptr, [8 x i8] }16%"F::Nope" = type {}17 18define internal void @_ZN2e34main17h934ff72f9a38d4bbE() unnamed_addr #0 !dbg !5 {19start:20 %qq = alloca %F, align 821 call void @llvm.dbg.declare(metadata ptr %qq, metadata !10, metadata !28), !dbg !2922 store ptr null, ptr %qq, !dbg !2923 ret void, !dbg !3024}25 26; Function Attrs: nounwind readnone27declare void @llvm.dbg.declare(metadata, metadata, metadata) #028 29attributes #0 = { nounwind uwtable }30 31!llvm.module.flags = !{!0, !1}32!llvm.dbg.cu = !{!2}33 34!0 = !{i32 1, !"PIE Level", i32 2}35!1 = !{i32 2, !"Debug Info Version", i32 3}36!2 = distinct !DICompileUnit(language: DW_LANG_Rust, file: !3, producer: "clang LLVM (rustc version 1.24.0-dev)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4)37!3 = !DIFile(filename: "e3.rs", directory: "/home/tromey/Rust")38!4 = !{}39!5 = distinct !DISubprogram(name: "main", linkageName: "_ZN2e34mainE", scope: !6, file: !3, line: 2, type: !8, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagMainSubprogram, isOptimized: false, unit: !2, templateParams: !4, retainedNodes: !4)40!6 = !DINamespace(name: "e3", scope: null)41!7 = !DIFile(filename: "<unknown>", directory: "")42!8 = !DISubroutineType(types: !9)43!9 = !{null}44!10 = !DILocalVariable(name: "qq", scope: !11, file: !3, line: 3, type: !12, align: 8)45!11 = distinct !DILexicalBlock(scope: !5, file: !3, line: 3, column: 4)46!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "F", scope: !6, file: !7, size: 128, align: 64, elements: !13, identifier: "7ce1efff6b82281ab9ceb730566e7e20")47!13 = !{!14}48!14 = !DICompositeType(tag: DW_TAG_variant_part, name: "", scope: !12, file: !7, size: 128, align: 64, elements: !16, identifier: "7ce1efff6b82281ab9ceb730566e7e20")49 50!16 = !{!17}51!17 = !DIDerivedType(tag: DW_TAG_member, scope: !14, file: !7, baseType: !18, size: 128, align: 64)52!18 = !DICompositeType(tag: DW_TAG_structure_type, name: "Yep", scope: !12, file: !7, size: 128, align: 64, elements: !19, identifier: "7ce1efff6b82281ab9ceb730566e7e20::Yep")53!19 = !{!20, !22}54!20 = !DIDerivedType(tag: DW_TAG_member, name: "__0", scope: !18, file: !7, baseType: !21, size: 8, align: 8, offset: 64)55!21 = !DIBasicType(name: "u8", size: 8, encoding: DW_ATE_unsigned)56!22 = !DIDerivedType(tag: DW_TAG_member, name: "__1", scope: !18, file: !7, baseType: !23, size: 64, align: 64)57!23 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "&u8", baseType: !21, size: 64, align: 64)58 59!28 = !DIExpression()60!29 = !DILocation(line: 3, scope: !11)61!30 = !DILocation(line: 4, scope: !5)62