138 lines · plain
1; RUN: llc -arm-global-merge -global-merge-group-by-use=false -filetype=obj < %s | llvm-dwarfdump -debug-info --name=x1 --name=x2 -v - | FileCheck %s2 3source_filename = "test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll"4target 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"5target triple = "thumbv7-apple-darwin10"6 7@x1 = internal global i8 1, align 1, !dbg !08@x2 = internal global i8 1, align 1, !dbg !49@x3 = internal global i8 1, align 1, !dbg !610@x4 = internal global i8 1, align 1, !dbg !811@x5 = global i8 1, align 1, !dbg !1012 13; CHECK: DW_TAG_variable14; CHECK: DW_AT_name {{.*}} "x1"15; CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr [[ADDR:0x[0-9a-fA-F]+]])16 17; CHECK: DW_TAG_variable18; CHECK: DW_AT_name {{.*}} "x2"19; CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr [[ADDR]], DW_OP_plus_uconst 0x1)20 21; Function Attrs: nounwind optsize22define zeroext i8 @get1(i8 zeroext %a) #0 !dbg !16 {23entry:24 tail call void @llvm.dbg.value(metadata i8 %a, metadata !20, metadata !23), !dbg !2425 %0 = load i8, ptr @x1, align 4, !dbg !2426 tail call void @llvm.dbg.value(metadata i8 %0, metadata !21, metadata !23), !dbg !2427 store i8 %a, ptr @x1, align 4, !dbg !2428 ret i8 %0, !dbg !2529}30 31; Function Attrs: nounwind readnone32declare void @llvm.dbg.value(metadata, metadata, metadata) #133 34; Function Attrs: nounwind optsize35define zeroext i8 @get2(i8 zeroext %a) #0 !dbg !26 {36entry:37 tail call void @llvm.dbg.value(metadata i8 %a, metadata !28, metadata !23), !dbg !3138 %0 = load i8, ptr @x2, align 4, !dbg !3139 tail call void @llvm.dbg.value(metadata i8 %0, metadata !29, metadata !23), !dbg !3140 store i8 %a, ptr @x2, align 4, !dbg !3141 ret i8 %0, !dbg !3242}43 44; Function Attrs: nounwind optsize45 46define zeroext i8 @get3(i8 zeroext %a) #0 !dbg !33 {47entry:48 tail call void @llvm.dbg.value(metadata i8 %a, metadata !35, metadata !23), !dbg !3849 %0 = load i8, ptr @x3, align 4, !dbg !3850 tail call void @llvm.dbg.value(metadata i8 %0, metadata !36, metadata !23), !dbg !3851 store i8 %a, ptr @x3, align 4, !dbg !3852 ret i8 %0, !dbg !3953}54 55; Function Attrs: nounwind optsize56 57define zeroext i8 @get4(i8 zeroext %a) #0 !dbg !40 {58entry:59 tail call void @llvm.dbg.value(metadata i8 %a, metadata !42, metadata !23), !dbg !4560 %0 = load i8, ptr @x4, align 4, !dbg !4561 tail call void @llvm.dbg.value(metadata i8 %0, metadata !43, metadata !23), !dbg !4562 store i8 %a, ptr @x4, align 4, !dbg !4563 ret i8 %0, !dbg !4664}65 66; Function Attrs: nounwind optsize67 68define zeroext i8 @get5(i8 zeroext %a) #0 !dbg !47 {69entry:70 tail call void @llvm.dbg.value(metadata i8 %a, metadata !49, metadata !23), !dbg !5271 %0 = load i8, ptr @x5, align 4, !dbg !5272 tail call void @llvm.dbg.value(metadata i8 %0, metadata !50, metadata !23), !dbg !5273 store i8 %a, ptr @x5, align 4, !dbg !5274 ret i8 %0, !dbg !5375}76 77attributes #0 = { nounwind optsize }78attributes #1 = { nounwind readnone }79 80!llvm.dbg.cu = !{!12}81!llvm.module.flags = !{!15}82 83!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())84!1 = !DIGlobalVariable(name: "x1", scope: !2, file: !2, line: 3, type: !3, isLocal: true, isDefinition: true)85!2 = !DIFile(filename: "foo.c", directory: "/tmp/")86!3 = !DIBasicType(name: "_Bool", size: 8, align: 8, encoding: DW_ATE_boolean)87!4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())88!5 = !DIGlobalVariable(name: "x2", scope: !2, file: !2, line: 6, type: !3, isLocal: true, isDefinition: true)89!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())90!7 = !DIGlobalVariable(name: "x3", scope: !2, file: !2, line: 9, type: !3, isLocal: true, isDefinition: true)91!8 = !DIGlobalVariableExpression(var: !9, expr: !DIExpression())92!9 = !DIGlobalVariable(name: "x4", scope: !2, file: !2, line: 12, type: !3, isLocal: true, isDefinition: true)93!10 = !DIGlobalVariableExpression(var: !11, expr: !DIExpression())94!11 = !DIGlobalVariable(name: "x5", scope: !2, file: !2, line: 15, type: !3, isLocal: false, isDefinition: true)95!12 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2369.8)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !13, retainedTypes: !13, globals: !14, imports: !13)96!13 = !{}97!14 = !{!0, !4, !6, !8, !10}98!15 = !{i32 1, !"Debug Info Version", i32 3}99!16 = distinct !DISubprogram(name: "get1", linkageName: "get1", scope: !2, file: !2, line: 4, type: !17, isLocal: false, isDefinition: true, scopeLine: 4, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, retainedNodes: !19)100!17 = !DISubroutineType(types: !18)101!18 = !{!3, !3}102!19 = !{!20, !21}103!20 = !DILocalVariable(name: "a", arg: 1, scope: !16, file: !2, line: 4, type: !3)104!21 = !DILocalVariable(name: "b", scope: !22, file: !2, line: 4, type: !3)105!22 = distinct !DILexicalBlock(scope: !16, file: !2, line: 4)106!23 = !DIExpression()107!24 = !DILocation(line: 4, scope: !16)108!25 = !DILocation(line: 4, scope: !22)109!26 = distinct !DISubprogram(name: "get2", linkageName: "get2", scope: !2, file: !2, line: 7, type: !17, isLocal: false, isDefinition: true, scopeLine: 7, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, retainedNodes: !27)110!27 = !{!28, !29}111!28 = !DILocalVariable(name: "a", arg: 1, scope: !26, file: !2, line: 7, type: !3)112!29 = !DILocalVariable(name: "b", scope: !30, file: !2, line: 7, type: !3)113!30 = distinct !DILexicalBlock(scope: !26, file: !2, line: 7)114!31 = !DILocation(line: 7, scope: !26)115!32 = !DILocation(line: 7, scope: !30)116!33 = distinct !DISubprogram(name: "get3", linkageName: "get3", scope: !2, file: !2, line: 10, type: !17, isLocal: false, isDefinition: true, scopeLine: 10, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, retainedNodes: !34)117!34 = !{!35, !36}118!35 = !DILocalVariable(name: "a", arg: 1, scope: !33, file: !2, line: 10, type: !3)119!36 = !DILocalVariable(name: "b", scope: !37, file: !2, line: 10, type: !3)120!37 = distinct !DILexicalBlock(scope: !33, file: !2, line: 10)121!38 = !DILocation(line: 10, scope: !33)122!39 = !DILocation(line: 10, scope: !37)123!40 = distinct !DISubprogram(name: "get4", linkageName: "get4", scope: !2, file: !2, line: 13, type: !17, isLocal: false, isDefinition: true, scopeLine: 13, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, retainedNodes: !41)124!41 = !{!42, !43}125!42 = !DILocalVariable(name: "a", arg: 1, scope: !40, file: !2, line: 13, type: !3)126!43 = !DILocalVariable(name: "b", scope: !44, file: !2, line: 13, type: !3)127!44 = distinct !DILexicalBlock(scope: !40, file: !2, line: 13)128!45 = !DILocation(line: 13, scope: !40)129!46 = !DILocation(line: 13, scope: !44)130!47 = distinct !DISubprogram(name: "get5", linkageName: "get5", scope: !2, file: !2, line: 16, type: !17, isLocal: false, isDefinition: true, scopeLine: 16, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !12, retainedNodes: !48)131!48 = !{!49, !50}132!49 = !DILocalVariable(name: "a", arg: 1, scope: !47, file: !2, line: 16, type: !3)133!50 = !DILocalVariable(name: "b", scope: !51, file: !2, line: 16, type: !3)134!51 = distinct !DILexicalBlock(scope: !47, file: !2, line: 16)135!52 = !DILocation(line: 16, scope: !47)136!53 = !DILocation(line: 16, scope: !51)137 138