blob: c3abccbc45cdf43277afef7a6a7bad40e26e8533 [file] [log] [blame]
Adrian Prantl274bcbc2017-06-16 22:40:04 +00001; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s
2; Generated at -O2 from:
3; bool c();
4; void f();
5; bool start() {
6; bool result = c();
7; if (!c()) {
8; result = false;
9; goto exit;
10; }
11; f();
12; result = true;
13; exit:
14; return result;
15; }
16;
17; The constant should NOT be available for the entire function.
18; CHECK-NOT: DW_AT_const_value
19; CHECK: .debug_loc
20; CHECK: Location description: 10 01 9f
21; constu 0x00000001, stack-value
22source_filename = "test.ii"
23target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
24target triple = "x86_64-apple-macosx10.12.0"
25
26; Function Attrs: noimplicitfloat noredzone nounwind optsize
27define zeroext i1 @_Z5startv() local_unnamed_addr #0 !dbg !7 {
28entry:
29 %call = tail call zeroext i1 @_Z1cv() #3, !dbg !13
30 %call1 = tail call zeroext i1 @_Z1cv() #3, !dbg !14
31 br i1 %call1, label %if.end, label %exit, !dbg !16
32
33if.end: ; preds = %entry
34 tail call void @_Z1fv() #3, !dbg !17
35 tail call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !12, metadata !18), !dbg !19
36 br label %exit, !dbg !20
37
38exit: ; preds = %entry, %if.end
39 %result.0 = phi i1 [ true, %if.end ], [ false, %entry ]
40 ret i1 %result.0, !dbg !21
41}
42
43; Function Attrs: noimplicitfloat noredzone optsize
44declare zeroext i1 @_Z1cv() local_unnamed_addr #1
45
46; Function Attrs: noimplicitfloat noredzone optsize
47declare void @_Z1fv() local_unnamed_addr #1
48
49; Function Attrs: nounwind readnone speculatable
50declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
51
52attributes #0 = { noimplicitfloat noredzone nounwind optsize }
53attributes #1 = { noimplicitfloat noredzone optsize }
54attributes #2 = { nounwind readnone speculatable }
55attributes #3 = { nobuiltin noimplicitfloat noredzone nounwind optsize }
56
57!llvm.dbg.cu = !{!0}
58!llvm.module.flags = !{!3, !4, !5}
59!llvm.ident = !{!6}
60
61!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)
62!1 = !DIFile(filename: "test.ii", directory: "/")
63!2 = !{}
64!3 = !{i32 2, !"Dwarf Version", i32 4}
65!4 = !{i32 2, !"Debug Info Version", i32 3}
66!5 = !{i32 1, !"wchar_size", i32 4}
67!6 = !{!"clang version 5.0.0 (trunk 303873) (llvm/trunk 303897)"}
68!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)
69!8 = !DISubroutineType(types: !9)
70!9 = !{!10}
71!10 = !DIBasicType(name: "bool", size: 8, encoding: DW_ATE_boolean)
72!11 = !{!12}
73!12 = !DILocalVariable(name: "result", scope: !7, file: !1, line: 4, type: !10)
74!13 = !DILocation(line: 4, column: 17, scope: !7)
75!14 = !DILocation(line: 5, column: 8, scope: !15)
76!15 = distinct !DILexicalBlock(scope: !7, file: !1, line: 5, column: 7)
77!16 = !DILocation(line: 5, column: 7, scope: !7)
78!17 = !DILocation(line: 9, column: 3, scope: !7)
79!18 = !DIExpression()
80!19 = !DILocation(line: 4, column: 8, scope: !7)
81!20 = !DILocation(line: 10, column: 3, scope: !7)
82!21 = !DILocation(line: 12, column: 3, scope: !7)