blob: 14eca434b83ee623acb2817cd1db3138f777a970 [file] [log] [blame]
Eric Christopher4150a772013-12-20 04:34:50 +00001; REQUIRES: object-emission
Eric Christopher3a70d002014-03-14 20:53:43 +00002; RUN: %llc_dwarf -O0 -filetype=obj %s -o %t
Eric Christopher46e23432013-12-20 04:16:18 +00003; RUN: llvm-dwarfdump %t | FileCheck %s
4
Eric Christopher3a70d002014-03-14 20:53:43 +00005; Check that we emit ranges for this which has a non-traditional section.
Eric Christopher46e23432013-12-20 04:16:18 +00006
7; CHECK: DW_TAG_compile_unit
8; CHECK: DW_AT_ranges
9; CHECK: DW_TAG_subprogram
10
11; CHECK: .debug_ranges contents:
12; FIXME: When we get better dumping facilities we'll want to elaborate here.
13; CHECK: 00000000 <End of list>
Eric Christopher46e23432013-12-20 04:16:18 +000014
15; Function Attrs: nounwind uwtable
Eric Christophera2a6e922014-03-14 21:16:54 +000016define i32 @foo(i32 %a) #0 section "__TEXT,__foo" {
Eric Christopher46e23432013-12-20 04:16:18 +000017entry:
18 %a.addr = alloca i32, align 4
19 store i32 %a, i32* %a.addr, align 4
20 call void @llvm.dbg.declare(metadata !{i32* %a.addr}, metadata !12), !dbg !13
21 %0 = load i32* %a.addr, align 4, !dbg !14
Eric Christopher3a70d002014-03-14 20:53:43 +000022 %add = add nsw i32 %0, 5, !dbg !14
Eric Christopher46e23432013-12-20 04:16:18 +000023 ret i32 %add, !dbg !14
24}
25
26; Function Attrs: nounwind readnone
27declare void @llvm.dbg.declare(metadata, metadata) #1
28
29attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
30attributes #1 = { nounwind readnone }
31
32!llvm.dbg.cu = !{!0}
33!llvm.module.flags = !{!9, !10}
34!llvm.ident = !{!11}
35
Eric Christopher3a70d002014-03-14 20:53:43 +000036!0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5.0 (trunk 203959) (llvm/trunk 203946)", i1 false, metadata !"", i32 0, metadata !2, metadata !2, metadata !3, metadata !2, metadata !2, metadata !"", i32 1} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/echristo/foo.c] [DW_LANG_C99]
37!1 = metadata !{metadata !"foo.c", metadata !"/usr/local/google/home/echristo"}
David Blaikie5e390e42014-02-04 01:23:52 +000038!2 = metadata !{}
Eric Christopher46e23432013-12-20 04:16:18 +000039!3 = metadata !{metadata !4}
Eric Christopher3a70d002014-03-14 20:53:43 +000040!4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"foo", metadata !"foo", metadata !"", i32 1, metadata !6, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, i32 (i32)* @foo, null, null, metadata !2, i32 1} ; [ DW_TAG_subprogram ] [line 1] [def] [foo]
41!5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] [/usr/local/google/home/echristo/foo.c]
Eric Christopher46e23432013-12-20 04:16:18 +000042!6 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !7, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
43!7 = metadata !{metadata !8, metadata !8}
44!8 = metadata !{i32 786468, null, null, metadata !"int", i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
45!9 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
46!10 = metadata !{i32 1, metadata !"Debug Info Version", i32 1}
Eric Christopher3a70d002014-03-14 20:53:43 +000047!11 = metadata !{metadata !"clang version 3.5.0 (trunk 203959) (llvm/trunk 203946)"}
Eric Christopher46e23432013-12-20 04:16:18 +000048!12 = metadata !{i32 786689, metadata !4, metadata !"a", metadata !5, i32 16777217, metadata !8, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [a] [line 1]
49!13 = metadata !{i32 1, i32 0, metadata !4, null}
50!14 = metadata !{i32 2, i32 0, metadata !4, null}