llvm.org GIT mirror llvm / 7b0eca9
Add previously accidentally uncommitted testcase for r305599. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305852 91177308-0d34-0410-b5e6-96231b3b80d8 Adrian Prantl 2 years ago
1 changed file(s) with 82 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s
1 ; Generated at -O2 from:
2 ; bool c();
3 ; void f();
4 ; bool start() {
5 ; bool result = c();
6 ; if (!c()) {
7 ; result = false;
8 ; goto exit;
9 ; }
10 ; f();
11 ; result = true;
12 ; exit:
13 ; return result;
14 ; }
15 ;
16 ; The constant should NOT be available for the entire function.
17 ; CHECK-NOT: DW_AT_const_value
18 ; CHECK: .debug_loc
19 ; CHECK: Location description: 10 01 9f
20 ; constu 0x00000001, stack-value
21 source_filename = "test.ii"
22 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
23 target triple = "x86_64-apple-macosx10.12.0"
24
25 ; Function Attrs: noimplicitfloat noredzone nounwind optsize
26 define zeroext i1 @_Z5startv() local_unnamed_addr #0 !dbg !7 {
27 entry:
28 %call = tail call zeroext i1 @_Z1cv() #3, !dbg !13
29 %call1 = tail call zeroext i1 @_Z1cv() #3, !dbg !14
30 br i1 %call1, label %if.end, label %exit, !dbg !16
31
32 if.end: ; preds = %entry
33 tail call void @_Z1fv() #3, !dbg !17
34 tail call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !12, metadata !18), !dbg !19
35 br label %exit, !dbg !20
36
37 exit: ; preds = %entry, %if.end
38 %result.0 = phi i1 [ true, %if.end ], [ false, %entry ]
39 ret i1 %result.0, !dbg !21
40 }
41
42 ; Function Attrs: noimplicitfloat noredzone optsize
43 declare zeroext i1 @_Z1cv() local_unnamed_addr #1
44
45 ; Function Attrs: noimplicitfloat noredzone optsize
46 declare void @_Z1fv() local_unnamed_addr #1
47
48 ; Function Attrs: nounwind readnone speculatable
49 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
50
51 attributes #0 = { noimplicitfloat noredzone nounwind optsize }
52 attributes #1 = { noimplicitfloat noredzone optsize }
53 attributes #2 = { nounwind readnone speculatable }
54 attributes #3 = { nobuiltin noimplicitfloat noredzone nounwind optsize }
55
56 !llvm.dbg.cu = !{!0}
57 !llvm.module.flags = !{!3, !4, !5}
58 !llvm.ident = !{!6}
59
60 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 303873) (llvm/trunk 303897)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
61 !1 = !DIFile(filename: "test.ii", directory: "/")
62 !2 = !{}
63 !3 = !{i32 2, !"Dwarf Version", i32 4}
64 !4 = !{i32 2, !"Debug Info Version", i32 3}
65 !5 = !{i32 1, !"wchar_size", i32 4}
66 !6 = !{!"clang version 5.0.0 (trunk 303873) (llvm/trunk 303897)"}
67 !7 = distinct !DISubprogram(name: "start", linkageName: "_Z5startv", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !11)
68 !8 = !DISubroutineType(types: !9)
69 !9 = !{!10}
70 !10 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)
71 !11 = !{!12}
72 !12 = !DILocalVariable(name: "result", scope: !7, file: !1, line: 4, type: !10)
73 !13 = !DILocation(line: 4, column: 17, scope: !7)
74 !14 = !DILocation(line: 5, column: 8, scope: !15)
75 !15 = distinct !DILexicalBlock(scope: !7, file: !1, line: 5, column: 7)
76 !16 = !DILocation(line: 5, column: 7, scope: !7)
77 !17 = !DILocation(line: 9, column: 3, scope: !7)
78 !18 = !DIExpression()
79 !19 = !DILocation(line: 4, column: 8, scope: !7)
80 !20 = !DILocation(line: 10, column: 3, scope: !7)
81 !21 = !DILocation(line: 12, column: 3, scope: !7)