Ahmed Bougacha | 279e3ee | 2015-04-18 01:21:58 +0000 | [diff] [blame] | 1 | ; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-dump=info - | FileCheck %s |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 2 | |
| 3 | ; Check debug info output for merged global. |
| 4 | ; DW_AT_location |
David Blaikie | cabf54a | 2014-08-05 23:57:31 +0000 | [diff] [blame] | 5 | ; 0x03 DW_OP_addr |
| 6 | ; 0x.. .long __MergedGlobals |
| 7 | ; 0x10 DW_OP_constu |
| 8 | ; 0x.. offset |
| 9 | ; 0x22 DW_OP_plus |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 10 | |
David Blaikie | cabf54a | 2014-08-05 23:57:31 +0000 | [diff] [blame] | 11 | ; CHECK: DW_TAG_variable |
| 12 | ; CHECK-NOT: DW_TAG |
| 13 | ; CHECK: DW_AT_name {{.*}} "x1" |
| 14 | ; CHECK-NOT: {{DW_TAG|NULL}} |
| 15 | ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR:.. .. .. ..]] 10 00 22 ) |
| 16 | ; CHECK: DW_TAG_variable |
| 17 | ; CHECK-NOT: DW_TAG |
| 18 | ; CHECK: DW_AT_name {{.*}} "x2" |
| 19 | ; CHECK-NOT: {{DW_TAG|NULL}} |
| 20 | ; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x8> 03 [[ADDR]] 10 04 22 ) |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 21 | |
| 22 | target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32" |
| 23 | target triple = "thumbv7-apple-macosx10.7.0" |
| 24 | |
| 25 | @x1 = internal unnamed_addr global i32 1, align 4 |
| 26 | @x2 = internal unnamed_addr global i32 2, align 4 |
| 27 | @x3 = internal unnamed_addr global i32 3, align 4 |
| 28 | @x4 = internal unnamed_addr global i32 4, align 4 |
| 29 | @x5 = global i32 0, align 4 |
| 30 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 31 | define i32 @get1(i32 %a) nounwind optsize ssp !dbg !1 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 32 | tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !10, metadata !DIExpression()), !dbg !30 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 33 | %1 = load i32, i32* @x1, align 4, !dbg !31 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 34 | tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !11, metadata !DIExpression()), !dbg !31 |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 35 | store i32 %a, i32* @x1, align 4, !dbg !31 |
| 36 | ret i32 %1, !dbg !31 |
| 37 | } |
| 38 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 39 | define i32 @get2(i32 %a) nounwind optsize ssp !dbg !6 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 40 | tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !13, metadata !DIExpression()), !dbg !32 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 41 | %1 = load i32, i32* @x2, align 4, !dbg !33 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 42 | tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !14, metadata !DIExpression()), !dbg !33 |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 43 | store i32 %a, i32* @x2, align 4, !dbg !33 |
| 44 | ret i32 %1, !dbg !33 |
| 45 | } |
| 46 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 47 | define i32 @get3(i32 %a) nounwind optsize ssp !dbg !7 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 48 | tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !16, metadata !DIExpression()), !dbg !34 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 49 | %1 = load i32, i32* @x3, align 4, !dbg !35 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 50 | tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !17, metadata !DIExpression()), !dbg !35 |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 51 | store i32 %a, i32* @x3, align 4, !dbg !35 |
| 52 | ret i32 %1, !dbg !35 |
| 53 | } |
| 54 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 55 | define i32 @get4(i32 %a) nounwind optsize ssp !dbg !8 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 56 | tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !19, metadata !DIExpression()), !dbg !36 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 57 | %1 = load i32, i32* @x4, align 4, !dbg !37 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 58 | tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !20, metadata !DIExpression()), !dbg !37 |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 59 | store i32 %a, i32* @x4, align 4, !dbg !37 |
| 60 | ret i32 %1, !dbg !37 |
| 61 | } |
| 62 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 63 | define i32 @get5(i32 %a) nounwind optsize ssp !dbg !9 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 64 | tail call void @llvm.dbg.value(metadata i32 %a, i64 0, metadata !27, metadata !DIExpression()), !dbg !38 |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 65 | %1 = load i32, i32* @x5, align 4, !dbg !39 |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 66 | tail call void @llvm.dbg.value(metadata i32 %1, i64 0, metadata !28, metadata !DIExpression()), !dbg !39 |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 67 | store i32 %a, i32* @x5, align 4, !dbg !39 |
| 68 | ret i32 %1, !dbg !39 |
| 69 | } |
| 70 | |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 71 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 72 | |
| 73 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 74 | !llvm.module.flags = !{!49} |
Devang Patel | dc9cbaa | 2011-08-03 01:25:46 +0000 | [diff] [blame] | 75 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 76 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: FullDebug, file: !47, enums: !48, retainedTypes: !48, globals: !41, imports: !48) |
| 77 | !1 = distinct !DISubprogram(name: "get1", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 5, file: !47, scope: !2, type: !3, variables: !42) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 78 | !2 = !DIFile(filename: "ss3.c", directory: "/private/tmp") |
| 79 | !3 = !DISubroutineType(types: !4) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 80 | !4 = !{!5} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 81 | !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 82 | !6 = distinct !DISubprogram(name: "get2", line: 8, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 8, file: !47, scope: !2, type: !3, variables: !43) |
| 83 | !7 = distinct !DISubprogram(name: "get3", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 11, file: !47, scope: !2, type: !3, variables: !44) |
| 84 | !8 = distinct !DISubprogram(name: "get4", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 14, file: !47, scope: !2, type: !3, variables: !45) |
| 85 | !9 = distinct !DISubprogram(name: "get5", line: 17, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 17, file: !47, scope: !2, type: !3, variables: !46) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 86 | !10 = !DILocalVariable(name: "a", line: 5, arg: 1, scope: !1, file: !2, type: !5) |
| 87 | !11 = !DILocalVariable(name: "b", line: 5, scope: !12, file: !2, type: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 88 | !12 = distinct !DILexicalBlock(line: 5, column: 19, file: !47, scope: !1) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 89 | !13 = !DILocalVariable(name: "a", line: 8, arg: 1, scope: !6, file: !2, type: !5) |
| 90 | !14 = !DILocalVariable(name: "b", line: 8, scope: !15, file: !2, type: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 91 | !15 = distinct !DILexicalBlock(line: 8, column: 17, file: !47, scope: !6) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 92 | !16 = !DILocalVariable(name: "a", line: 11, arg: 1, scope: !7, file: !2, type: !5) |
| 93 | !17 = !DILocalVariable(name: "b", line: 11, scope: !18, file: !2, type: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 94 | !18 = distinct !DILexicalBlock(line: 11, column: 19, file: !47, scope: !7) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 95 | !19 = !DILocalVariable(name: "a", line: 14, arg: 1, scope: !8, file: !2, type: !5) |
| 96 | !20 = !DILocalVariable(name: "b", line: 14, scope: !21, file: !2, type: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 97 | !21 = distinct !DILexicalBlock(line: 14, column: 19, file: !47, scope: !8) |
| 98 | !25 = !DIGlobalVariable(name: "x1", line: 4, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5, variable: i32* @x1) |
| 99 | !26 = !DIGlobalVariable(name: "x2", line: 7, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !5, variable: i32* @x2) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 100 | !27 = !DILocalVariable(name: "a", line: 17, arg: 1, scope: !9, file: !2, type: !5) |
| 101 | !28 = !DILocalVariable(name: "b", line: 17, scope: !29, file: !2, type: !5) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 102 | !29 = distinct !DILexicalBlock(line: 17, column: 19, file: !47, scope: !9) |
| 103 | !30 = !DILocation(line: 5, column: 16, scope: !1) |
| 104 | !31 = !DILocation(line: 5, column: 32, scope: !12) |
| 105 | !32 = !DILocation(line: 8, column: 14, scope: !6) |
| 106 | !33 = !DILocation(line: 8, column: 29, scope: !15) |
| 107 | !34 = !DILocation(line: 11, column: 16, scope: !7) |
| 108 | !35 = !DILocation(line: 11, column: 32, scope: !18) |
| 109 | !36 = !DILocation(line: 14, column: 16, scope: !8) |
| 110 | !37 = !DILocation(line: 14, column: 32, scope: !21) |
| 111 | !38 = !DILocation(line: 17, column: 16, scope: !9) |
| 112 | !39 = !DILocation(line: 17, column: 32, scope: !29) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 113 | !41 = !{!25, !26} |
| 114 | !42 = !{!10, !11} |
| 115 | !43 = !{!13, !14} |
| 116 | !44 = !{!16, !17} |
| 117 | !45 = !{!19, !20} |
| 118 | !46 = !{!27, !28} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 119 | !47 = !DIFile(filename: "ss3.c", directory: "/private/tmp") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 120 | !48 = !{} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 121 | !49 = !{i32 1, !"Debug Info Version", i32 3} |