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 |
Adrian Prantl | 16aa4cf | 2017-09-11 23:05:20 +0000 | [diff] [blame] | 2 | ; RUN: llvm-dwarfdump -v -debug-info %t | FileCheck %s |
Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 3 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 4 | source_filename = "test/DebugInfo/X86/nondefault-subrange-array.ll" |
| 5 | |
Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 6 | %class.A = type { [42 x i32] } |
| 7 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 8 | @a = global %class.A zeroinitializer, align 4, !dbg !0 |
Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 9 | ; Check that we can handle non-default array bounds. In this case, the array |
| 10 | ; goes from [-3, 38]. |
| 11 | |
Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 12 | ; CHECK: DW_TAG_class_type |
| 13 | ; CHECK: DW_TAG_member |
| 14 | ; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "x") |
Jonas Devlieghere | aa6be82 | 2017-10-10 14:15:25 +0000 | [diff] [blame] | 15 | ; 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] | 16 | |
Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 17 | ; CHECK: [[ARRAY]]: DW_TAG_array_type [{{.*}}] * |
Jonas Devlieghere | aa6be82 | 2017-10-10 14:15:25 +0000 | [diff] [blame] | 18 | ; 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] | 19 | |
Manman Ren | f6b936b | 2013-10-29 05:49:41 +0000 | [diff] [blame] | 20 | ; CHECK: DW_TAG_subrange_type |
Jonas Devlieghere | aa6be82 | 2017-10-10 14:15:25 +0000 | [diff] [blame] | 21 | ; 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] | 22 | ; CHECK-NEXT: DW_AT_lower_bound [DW_FORM_data8] (0xfffffffffffffffd) |
David Blaikie | 32b0f36 | 2014-10-01 00:56:55 +0000 | [diff] [blame] | 23 | ; CHECK-NEXT: DW_AT_count [DW_FORM_data1] (0x2a) |
Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 24 | |
Manman Ren | f4c339e | 2013-10-29 22:49:29 +0000 | [diff] [blame] | 25 | ; CHECK: [[BASE]]: DW_TAG_base_type |
| 26 | ; CHECK: [[BASE2]]: DW_TAG_base_type |
Pavel Labath | b7243ed | 2018-04-10 14:23:41 +0000 | [diff] [blame] | 27 | ; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ( .debug_str[0x{{[0-9a-f]*}}] = "__ARRAY_SIZE_TYPE__") |
David Blaikie | 12e00fc | 2014-04-03 06:28:20 +0000 | [diff] [blame] | 28 | ; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x08) |
Frederic Riss | 878065b | 2014-09-04 19:39:20 +0000 | [diff] [blame] | 29 | ; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (DW_ATE_unsigned) |
Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 30 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 31 | !llvm.dbg.cu = !{!14} |
| 32 | !llvm.module.flags = !{!17} |
Bill Wendling | 28fe9e7 | 2012-12-06 07:38:10 +0000 | [diff] [blame] | 33 | |
Adrian Prantl | 0578221 | 2017-08-30 18:06:51 +0000 | [diff] [blame] | 34 | !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 35 | !1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true) |
| 36 | !2 = !DIFile(filename: "t.cpp", directory: "/Volumes/Sandbox/llvm") |
| 37 | !3 = !DICompositeType(tag: DW_TAG_class_type, name: "A", file: !2, line: 1, align: 32, elements: !4) |
| 38 | !4 = !{!5, !10} |
| 39 | !5 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !3, file: !2, line: 1, baseType: !6, flags: DIFlagPrivate) |
| 40 | !6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, align: 32, elements: !8) |
| 41 | !7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 42 | !8 = !{!9} |
| 43 | !9 = !DISubrange(count: 42, lowerBound: -3) |
| 44 | !10 = !DISubprogram(name: "A", scope: !3, file: !2, line: 1, type: !11, isLocal: false, isDefinition: false, scopeLine: 1, virtualIndex: 6, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false) |
| 45 | !11 = !DISubroutineType(types: !12) |
| 46 | !12 = !{null, !13} |
| 47 | !13 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !3, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) |
| 48 | !14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !2, producer: "clang version 3.3 (trunk 169136)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !15, retainedTypes: !15, globals: !16, imports: !15) |
| 49 | !15 = !{} |
| 50 | !16 = !{!0} |
| 51 | !17 = !{i32 1, !"Debug Info Version", i32 3} |
| 52 | |