| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-apple-darwin -O0 -filetype=obj -o %t < %s |
| Eli Bendersky | e6abe83 | 2013-01-25 21:44:53 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s |
| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 3 | |
| 4 | %class.A = type { [42 x i32] } |
| 5 | |
| 6 | @a = global %class.A zeroinitializer, align 4 |
| 7 | |
| 8 | ; Check that we can handle non-default array bounds. In this case, the array |
| 9 | ; goes from [-3, 38]. |
| 10 | |
| Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 11 | ; CHECK: DW_TAG_class_type |
| 12 | ; CHECK: DW_TAG_member |
| 13 | ; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "x") |
| 14 | ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[ARRAY:0x[0-9a-f]*]]}) |
| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 15 | |
| Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 16 | ; CHECK: [[ARRAY]]: DW_TAG_array_type [{{.*}}] * |
| 17 | ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASE:0x[0-9a-f]*]]}) |
| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 18 | |
| Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 19 | ; CHECK: DW_TAG_subrange_type |
| Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 20 | ; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[BASE2:0x[0-9a-f]*]]}) |
| David Blaikie | 175b0b9 | 2013-08-19 03:36:23 +0000 | [diff] [blame] | 21 | ; CHECK-NEXT: DW_AT_lower_bound [DW_FORM_data8] (0xfffffffffffffffd) |
| David Blaikie | 32b0f36 | 2014-10-01 00:56:55 +0000 | [diff] [blame] | 22 | ; CHECK-NEXT: DW_AT_count [DW_FORM_data1] (0x2a) |
| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 23 | |
| Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 24 | ; CHECK: [[BASE]]: DW_TAG_base_type |
| 25 | ; CHECK: [[BASE2]]: DW_TAG_base_type |
| David Blaikie | 12e00fc | 2014-04-03 06:28:20 +0000 | [diff] [blame] | 26 | ; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "sizetype") |
| 27 | ; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x08) |
| Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 28 | ; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (DW_ATE_unsigned) |
| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 29 | |
| 30 | !llvm.dbg.cu = !{!0} |
| Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 31 | !llvm.module.flags = !{!21} |
| Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 32 | |
| Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 33 | !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, emissionKind: 0, file: !20, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 34 | !1 = !{} |
| 35 | !3 = !{!5} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 36 | !5 = !DIGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: %class.A* @a) |
| 37 | !6 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm") |
| 38 | !7 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 1, align: 32, file: !20, elements: !8) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 39 | !8 = !{!9, !14} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 40 | !9 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 1, flags: DIFlagPrivate, file: !20, scope: !7, baseType: !10) |
| 41 | !10 = !DICompositeType(tag: DW_TAG_array_type, align: 32, baseType: !11, elements: !12) |
| 42 | !11 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 43 | !12 = !{!13} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 44 | !13 = !DISubrange(count: 42, lowerBound: -3) |
| 45 | !14 = !DISubprogram(name: "A", line: 1, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !6, scope: !7, type: !15) |
| 46 | !15 = !DISubroutineType(types: !16) |
| Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 47 | !16 = !{null, !17} |
| Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 48 | !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !7) |
| 49 | !20 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm") |
| Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 50 | !21 = !{i32 1, !"Debug Info Version", i32 3} |