Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 1 | ; RUN: llc -O0 -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s |
Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 3 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 4 | source_filename = "test/DebugInfo/X86/enum-class.ll" |
Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 5 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 6 | @a = global i32 0, align 4, !dbg !0 |
| 7 | @b = global i64 0, align 8, !dbg !7 |
| 8 | @c = global i32 0, align 4, !dbg !13 |
Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 9 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 10 | !llvm.dbg.cu = !{!18} |
| 11 | !llvm.module.flags = !{!22} |
| 12 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 13 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 14 | !1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 4, type: !3, isLocal: false, isDefinition: true) |
| 15 | !2 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp") |
| 16 | !3 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "A", file: !2, line: 1, baseType: !4, size: 32, align: 32, elements: !5) |
| 17 | !4 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 18 | !5 = !{!6} |
| 19 | !6 = !DIEnumerator(name: "A1", value: 1) |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 20 | !7 = !DIGlobalVariableExpression(var: !8, expr: !DIExpression()) ; [ DW_TAG_enumerator ] |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 21 | !8 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 5, type: !9, isLocal: false, isDefinition: true) |
| 22 | !9 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "B", file: !2, line: 2, baseType: !10, size: 64, align: 64, elements: !11) |
| 23 | !10 = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned) |
| 24 | !11 = !{!12} |
| 25 | !12 = !DIEnumerator(name: "B1", value: 1) ; [ DW_TAG_enumerator ] |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 26 | !13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 27 | !14 = !DIGlobalVariable(name: "c", scope: null, file: !2, line: 6, type: !15, isLocal: false, isDefinition: true) |
| 28 | !15 = !DICompositeType(tag: DW_TAG_enumeration_type, name: "C", file: !2, line: 3, size: 32, align: 32, elements: !16) |
| 29 | !16 = !{!17} |
| 30 | !17 = !DIEnumerator(name: "C1", value: 1) ; [ DW_TAG_enumerator ] |
| 31 | !18 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.2 (trunk 157269) (llvm/trunk 157264)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !19, retainedTypes: !20, globals: !21, imports: !20) |
| 32 | !19 = !{!3, !9, !15} |
| 33 | !20 = !{} |
| 34 | !21 = !{!0, !7, !13} |
| 35 | !22 = !{i32 1, !"Debug Info Version", i32 3} |
Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 36 | |
Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 37 | ; CHECK: DW_TAG_enumeration_type [{{.*}}] |
Eric Christopher | e31e072 | 2013-09-04 22:21:24 +0000 | [diff] [blame] | 38 | ; CHECK: DW_AT_type [DW_FORM_ref4] |
Eric Christopher | 6b8209b | 2013-10-04 22:40:10 +0000 | [diff] [blame] | 39 | ; CHECK: DW_AT_enum_class [DW_FORM_flag_present] (true) |
Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 40 | ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "A") |
| 41 | |
Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 42 | ; CHECK: DW_TAG_enumeration_type [{{.*}}] * |
Eric Christopher | e31e072 | 2013-09-04 22:21:24 +0000 | [diff] [blame] | 43 | ; CHECK: DW_AT_type [DW_FORM_ref4] |
Eric Christopher | 6b8209b | 2013-10-04 22:40:10 +0000 | [diff] [blame] | 44 | ; CHECK: DW_AT_enum_class [DW_FORM_flag_present] (true) |
Eric Christopher | c496435 | 2012-05-23 00:09:20 +0000 | [diff] [blame] | 45 | ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "B") |
| 46 | |
| 47 | ; CHECK: DW_TAG_enumeration_type [6] |
| 48 | ; CHECK-NOT: DW_AT_enum_class |
| 49 | ; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[{{.*}}] = "C") |