llvm.org GIT mirror llvm / 735419d
DwarfWrite is now smart enough to drop debug value pointing to undefined register. Update this test to avoid this. iSel not properly lowring argument into a well formed DBG_VALUE in some cases is a separate issue and not related to the test in this testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105295 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
1 changed file(s) with 36 addition(s) and 41 deletion(s). Raw diff Collapse all Expand all
None ; RUN: llc < %s | FileCheck %s
0 ; RUN: llc -mtriple=x86_64-apple-darwin < %s | FileCheck %s
11 ; Test to check separate label for inlined function argument.
2 define void @bar(double %x) nounwind {
2
3 define i32 @foo(i32 %y) nounwind optsize ssp {
34 entry:
4 %__x_addr.i = alloca double ; [#uses=2]
5 %retval.i = alloca i32 ; [#uses=2]
6 %0 = alloca i32 ; [#uses=2]
7 %x_addr = alloca double ; [#uses=2]
8 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
9 call void @llvm.dbg.declare(metadata !{double* %x_addr}, metadata !0), !dbg !7
10 store double %x, double* %x_addr
11 %1 = load double* %x_addr, align 8, !dbg !8 ; [#uses=1]
12 call void @llvm.dbg.declare(metadata !{double* %__x_addr.i}, metadata !10), !dbg !15
13 store double %1, double* %__x_addr.i
14 %2 = load double* %__x_addr.i, align 8, !dbg !15 ; [#uses=1]
15 %3 = fptosi double %2 to i32, !dbg !15 ; [#uses=1]
16 store i32 %3, i32* %0, align 4, !dbg !15
17 %4 = load i32* %0, align 4, !dbg !15 ; [#uses=1]
18 store i32 %4, i32* %retval.i, align 4, !dbg !15
19 %retval1.i = load i32* %retval.i, !dbg !15 ; [#uses=0]
20 br label %return, !dbg !16
21
22 return: ; preds = %entry
23 ret void, !dbg !16
5 tail call void @llvm.dbg.value(metadata !{i32 %y}, i64 0, metadata !0)
6 %0 = tail call i32 (...)* @zoo(i32 %y) nounwind, !dbg !9 ; [#uses=1]
7 ret i32 %0, !dbg !9
248 }
259
26 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
10 declare i32 @zoo(...)
2711
28 !0 = metadata !{i32 524545, metadata !1, metadata !"x", metadata !2, i32 7, metadata !6} ; [ DW_TAG_arg_variable ]
29 !1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"bar", metadata !"bar", metadata !"bar", metadata !2, i32 7, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
30 !2 = metadata !{i32 524329, metadata !"2010-01-18-Inlined-Debug.c", metadata !"/Users/buildslave/zorg/buildbot/smooshlab/slave/build.llvm-gcc-powerpc-darwin9/llvm.src/test/FrontendC", metadata !3} ; [ DW_TAG_file_type ]
31 !3 = metadata !{i32 524305, i32 0, i32 1, metadata !"2010-01-18-Inlined-Debug.c", metadata !"/Users/buildslave/zorg/buildbot/smooshlab/slave/build.llvm-gcc-powerpc-darwin9/llvm.src/test/FrontendC", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
12 declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
13
14 define i32 @bar(i32 %x) nounwind optsize ssp {
15 entry:
16 tail call void @llvm.dbg.value(metadata !{i32 %x}, i64 0, metadata !7)
17 tail call void @llvm.dbg.value(metadata !11, i64 0, metadata !0) nounwind
18 %0 = tail call i32 (...)* @zoo(i32 1) nounwind, !dbg !12 ; [#uses=1]
19 %1 = add nsw i32 %0, %x, !dbg !13 ; [#uses=1]
20 ret i32 %1, !dbg !13
21 }
22
23 !llvm.dbg.lv = !{!0, !7}
24
25 !0 = metadata !{i32 524545, metadata !1, metadata !"y", metadata !2, i32 2, metadata !6} ; [ DW_TAG_arg_variable ]
26 !1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 2, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ]
27 !2 = metadata !{i32 524329, metadata !"f.c", metadata !"/tmp", metadata !3} ; [ DW_TAG_file_type ]
28 !3 = metadata !{i32 524305, i32 0, i32 1, metadata !"f.c", metadata !"/tmp", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 true, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
3229 !4 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ]
33 !5 = metadata !{null, metadata !6}
34 !6 = metadata !{i32 524324, metadata !2, metadata !"double", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, i32 4} ; [ DW_TAG_base_type ]
35 !7 = metadata !{i32 7, i32 0, metadata !1, null}
36 !8 = metadata !{i32 8, i32 0, metadata !9, null}
37 !9 = metadata !{i32 524299, metadata !1, i32 7, i32 0} ; [ DW_TAG_lexical_block ]
38 !10 = metadata !{i32 524545, metadata !11, metadata !"__x", metadata !2, i32 5, metadata !6} ; [ DW_TAG_arg_variable ]
39 !11 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 5, metadata !12, i1 true, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
40 !12 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !13, i32 0, null} ; [ DW_TAG_subroutine_type ]
41 !13 = metadata !{metadata !14, metadata !6}
42 !14 = metadata !{i32 524324, metadata !2, metadata !"int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
43 !15 = metadata !{i32 5, i32 0, metadata !11, metadata !8}
44 !16 = metadata !{i32 9, i32 0, metadata !9, null}
30 !5 = metadata !{metadata !6, metadata !6}
31 !6 = metadata !{i32 524324, metadata !2, metadata !"int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
32 !7 = metadata !{i32 524545, metadata !8, metadata !"x", metadata !2, i32 6, metadata !6} ; [ DW_TAG_arg_variable ]
33 !8 = metadata !{i32 524334, i32 0, metadata !2, metadata !"bar", metadata !"bar", metadata !"bar", metadata !2, i32 6, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 true} ; [ DW_TAG_subprogram ]
34 !9 = metadata !{i32 3, i32 0, metadata !10, null}
35 !10 = metadata !{i32 524299, metadata !1, i32 2, i32 0} ; [ DW_TAG_lexical_block ]
36 !11 = metadata !{i32 1}
37 !12 = metadata !{i32 3, i32 0, metadata !10, metadata !13}
38 !13 = metadata !{i32 7, i32 0, metadata !14, null}
39 !14 = metadata !{i32 524299, metadata !8, i32 6, i32 0} ; [ DW_TAG_lexical_block ]
4540
46 ;CHECK: DEBUG_VALUE: bar:x
41 ;CHECK: DEBUG_VALUE: bar:x <- EBX+0
4742 ;CHECK-NEXT:Ltmp
48 ;CHECK-NEXT DEBUG_VALUE: foo:__x
43 ;CHECK-NEXT DEBUG_VALUE: foo:y <- 1+0