|
| 1 | +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s --check-prefix=CHECK-METADATA |
| 2 | + |
| 3 | +; C++ source to regenerate: |
| 4 | +; enum __attribute__((enum_extensibility(open))) OpenEnum { |
| 5 | +; oe1 |
| 6 | +; } oe; |
| 7 | +; |
| 8 | +; enum __attribute__((enum_extensibility(closed))) ClosedEnum { |
| 9 | +; ce1 |
| 10 | +; } ce; |
| 11 | +; |
| 12 | +; $ clang++ -O0 -g debug-info-enum-kind.cpp -c |
| 13 | + |
| 14 | +; CHECK-METADATA: enumKind: DW_APPLE_ENUM_KIND_Open |
| 15 | +; CHECK-METADATA: enumKind: DW_APPLE_ENUM_KIND_Closed |
| 16 | + |
| 17 | +source_filename = "enum.cpp" |
| 18 | +target triple = "arm64-apple-macosx" |
| 19 | + |
| 20 | +@oe = global i32 0, align 4, !dbg !0 |
| 21 | +@ce = global i32 0, align 4, !dbg !13 |
| 22 | + |
| 23 | +!llvm.dbg.cu = !{!2} |
| 24 | +!llvm.module.flags = !{!15, !16} |
| 25 | + |
| 26 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 27 | +!1 = distinct !DIGlobalVariable(name: "oe", scope: !2, file: !3, line: 3, type: !5, isLocal: false, isDefinition: true) |
| 28 | +!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !3, producer: "clang version 21.0.0git", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !12, splitDebugInlining: false, nameTableKind: Apple, sysroot: "/") |
| 29 | +!3 = !DIFile(filename: "enum.cpp", directory: "/tmp") |
| 30 | +!4 = !{!5, !9} |
| 31 | +!5 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "OpenEnum", file: !3, line: 1, baseType: !6, size: 32, elements: !7, identifier: "_ZTS8OpenEnum", enumKind: DW_APPLE_ENUM_KIND_Open) |
| 32 | +!6 = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned) |
| 33 | +!7 = !{!8} |
| 34 | +!8 = !DIEnumerator(name: "oe1", value: 0, isUnsigned: true) |
| 35 | +!9 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "ClosedEnum", file: !3, line: 5, baseType: !6, size: 32, elements: !10, identifier: "_ZTS10ClosedEnum", enumKind: DW_APPLE_ENUM_KIND_Closed) |
| 36 | +!10 = !{!11} |
| 37 | +!11 = !DIEnumerator(name: "ce1", value: 0, isUnsigned: true) |
| 38 | +!12 = !{!0, !13} |
| 39 | +!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression()) |
| 40 | +!14 = distinct !DIGlobalVariable(name: "ce", scope: !2, file: !3, line: 7, type: !9, isLocal: false, isDefinition: true) |
| 41 | +!15 = !{i32 7, !"Dwarf Version", i32 5} |
| 42 | +!16 = !{i32 2, !"Debug Info Version", i32 3} |
0 commit comments