llvm.org GIT mirror llvm / 3d5f46b
Move this test to the backend from the frontend. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209259 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 6 years ago
1 changed file(s) with 50 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llc -mtriple=x86_64-linux-gnu %s -filetype=obj -o %t
1 ; RUN: llvm-dwarfdump %t | FileCheck %s
2
3 ; static void foo() {
4 ; struct X { int a; int b; } xyz;
5 ; }
6
7 ; int bar() {
8 ; foo();
9 ; return 1;
10 ; }
11
12 ; Check that we still have the structure type for X even though we're not
13 ; going to emit a low/high_pc for foo.
14 ; CHECK: DW_TAG_structure_type
15
16 ; Function Attrs: nounwind readnone uwtable
17 define i32 @bar() #0 {
18 entry:
19 ret i32 1, !dbg !21
20 }
21
22 attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
23
24 !llvm.dbg.cu = !{!0}
25 !llvm.module.flags = !{!18, !19}
26 !llvm.ident = !{!20}
27
28 !0 = metadata !{i32 786449, metadata !1, i32 12, metadata !"clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", i1 true, 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/debug-dead-local-var.c] [DW_LANG_C99]
29 !1 = metadata !{metadata !"debug-dead-local-var.c", metadata !"/usr/local/google/home/echristo"}
30 !2 = metadata !{}
31 !3 = metadata !{metadata !4, metadata !9}
32 !4 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"bar", metadata !"bar", metadata !"", i32 11, metadata !6, i1 false, i1 true, i32 0, i32 0, null, i32 0, i1 true, i32 ()* @bar, null, null, metadata !2, i32 11} ; [ DW_TAG_subprogram ] [line 11] [def] [bar]
33 !5 = metadata !{i32 786473, metadata !1} ; [ DW_TAG_file_type ] [/usr/local/google/home/echristo/debug-dead-local-var.c]
34 !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 ]
35 !7 = metadata !{metadata !8}
36 !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]
37 !9 = metadata !{i32 786478, metadata !1, metadata !5, metadata !"foo", metadata !"foo", metadata !"", i32 6, metadata !10, i1 true, i1 true, i32 0, i32 0, null, i32 0, i1 true, null, null, null, metadata !12, i32 6} ; [ DW_TAG_subprogram ] [line 6] [local] [def] [foo]
38 !10 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !11, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
39 !11 = metadata !{null}
40 !12 = metadata !{metadata !13}
41 !13 = metadata !{i32 786688, metadata !9, metadata !"xyz", metadata !5, i32 8, metadata !14, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [xyz] [line 8]
42 !14 = metadata !{i32 786451, metadata !1, metadata !9, metadata !"X", i32 8, i64 64, i64 32, i32 0, i32 0, null, metadata !15, i32 0, null, null, null} ; [ DW_TAG_structure_type ] [X] [line 8, size 64, align 32, offset 0] [def] [from ]
43 !15 = metadata !{metadata !16, metadata !17}
44 !16 = metadata !{i32 786445, metadata !1, metadata !14, metadata !"a", i32 8, i64 32, i64 32, i64 0, i32 0, metadata !8} ; [ DW_TAG_member ] [a] [line 8, size 32, align 32, offset 0] [from int]
45 !17 = metadata !{i32 786445, metadata !1, metadata !14, metadata !"b", i32 8, i64 32, i64 32, i64 32, i32 0, metadata !8} ; [ DW_TAG_member ] [b] [line 8, size 32, align 32, offset 32] [from int]
46 !18 = metadata !{i32 2, metadata !"Dwarf Version", i32 4}
47 !19 = metadata !{i32 2, metadata !"Debug Info Version", i32 1}
48 !20 = metadata !{metadata !"clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)"}
49 !21 = metadata !{i32 13, i32 0, metadata !4, null}