llvm.org GIT mirror llvm / 518e21a
Update tests. Now DBG_VALUE instruction is created only if alloca corresponding to llvm.dbg.declare is missing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102524 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
1 changed file(s) with 35 addition(s) and 39 deletion(s). Raw diff Collapse all Expand all
44 ; Currently, dbg.declare generates a DEBUG_VALUE comment. Eventually it will
55 ; generate DWARF and this test will need to be modified or removed.
66
7 @Y = common global i32 0 ; [#uses=1]
87
9 define i32 @test() nounwind {
8 %struct.Pt = type { double, double }
9 %struct.Rect = type { %struct.Pt, %struct.Pt }
10
11 define double @foo(%struct.Rect* byval %my_r0) nounwind ssp {
1012 entry:
11 ; CHECK: DEBUG_VALUE:
12 %retval = alloca i32 ; [#uses=2]
13 %X = alloca i32 ; [#uses=5]
14 %0 = alloca i32 ; [#uses=2]
13 ;CHECK: DEBUG_VALUE
14 %retval = alloca double ; [#uses=2]
15 %0 = alloca double ; [#uses=2]
1516 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
16 call void @llvm.dbg.declare(metadata !{i32* %X}, metadata !3), !dbg !7
17 store i32 4, i32* %X, align 4, !dbg !8
18 %1 = load i32* %X, align 4, !dbg !9 ; [#uses=1]
19 call void @use(i32 %1) nounwind, !dbg !9
20 %2 = load i32* @Y, align 4, !dbg !10 ; [#uses=1]
21 %3 = add nsw i32 %2, 2, !dbg !10 ; [#uses=1]
22 store i32 %3, i32* %X, align 4, !dbg !10
23 %4 = load i32* %X, align 4, !dbg !11 ; [#uses=1]
24 call void @use(i32 %4) nounwind, !dbg !11
25 %5 = load i32* %X, align 4, !dbg !12 ; [#uses=1]
26 store i32 %5, i32* %0, align 4, !dbg !12
27 %6 = load i32* %0, align 4, !dbg !12 ; [#uses=1]
28 store i32 %6, i32* %retval, align 4, !dbg !12
29 br label %return, !dbg !12
17 call void @llvm.dbg.declare(metadata !{%struct.Rect* %my_r0}, metadata !0), !dbg !15
18 %1 = getelementptr inbounds %struct.Rect* %my_r0, i32 0, i32 0, !dbg !16 ; <%struct.Pt*> [#uses=1]
19 %2 = getelementptr inbounds %struct.Pt* %1, i32 0, i32 0, !dbg !16 ; [#uses=1]
20 %3 = load double* %2, align 8, !dbg !16 ; [#uses=1]
21 store double %3, double* %0, align 8, !dbg !16
22 %4 = load double* %0, align 8, !dbg !16 ; [#uses=1]
23 store double %4, double* %retval, align 8, !dbg !16
24 br label %return, !dbg !16
3025
3126 return: ; preds = %entry
32 %retval1 = load i32* %retval, !dbg !12 ; [#uses=1]
33 ret i32 %retval1, !dbg !12
27 %retval1 = load double* %retval, !dbg !16 ; [#uses=1]
28 ret double %retval1, !dbg !16
3429 }
3530
3631 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
3732
38 declare void @use(i32)
39
40 !llvm.dbg.gv = !{!0}
41
42 !0 = metadata !{i32 458804, i32 0, metadata !1, metadata !"Y", metadata !"Y", metadata !"Y", metadata !1, i32 2, metadata !2, i1 false, i1 true, i32* @Y} ; [ DW_TAG_variable ]
43 !1 = metadata !{i32 458769, i32 0, i32 1, metadata !"try.c", metadata !"/Volumes/MacOS9/tests/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
44 !2 = metadata !{i32 458788, metadata !1, metadata !"int", metadata !1, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
45 !3 = metadata !{i32 459008, metadata !4, metadata !"X", metadata !1, i32 4, metadata !2} ; [ DW_TAG_auto_variable ]
46 !4 = metadata !{i32 458798, i32 0, metadata !1, metadata !"", metadata !"", metadata !"test", metadata !1, i32 3, metadata !5, i1 false, i1 true, i32 0, i32 0, null} ; [ DW_TAG_subprogram ]
47 !5 = metadata !{i32 458773, metadata !1, metadata !"", metadata !1, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !6, i32 0} ; [ DW_TAG_subroutine_type ]
48 !6 = metadata !{metadata !2}
49 !7 = metadata !{i32 3, i32 0, metadata !4, null}
50 !8 = metadata !{i32 4, i32 0, metadata !4, null}
51 !9 = metadata !{i32 5, i32 0, metadata !4, null}
52 !10 = metadata !{i32 6, i32 0, metadata !4, null}
53 !11 = metadata !{i32 7, i32 0, metadata !4, null}
54 !12 = metadata !{i32 8, i32 0, metadata !4, null}
33 !0 = metadata !{i32 524545, metadata !1, metadata !"my_r0", metadata !2, i32 11, metadata !7} ; [ DW_TAG_arg_variable ]
34 !1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 11, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ]
35 !2 = metadata !{i32 524329, metadata !"b2.c", metadata !"/tmp/", metadata !3} ; [ DW_TAG_file_type ]
36 !3 = metadata !{i32 524305, i32 0, i32 1, metadata !"b2.c", metadata !"/tmp/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
37 !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 ]
38 !5 = metadata !{metadata !6, metadata !7}
39 !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 ]
40 !7 = metadata !{i32 524307, metadata !2, metadata !"Rect", metadata !2, i32 6, i64 256, i64 64, i64 0, i32 0, null, metadata !8, i32 0, null} ; [ DW_TAG_structure_type ]
41 !8 = metadata !{metadata !9, metadata !14}
42 !9 = metadata !{i32 524301, metadata !7, metadata !"P1", metadata !2, i32 7, i64 128, i64 64, i64 0, i32 0, metadata !10} ; [ DW_TAG_member ]
43 !10 = metadata !{i32 524307, metadata !2, metadata !"Pt", metadata !2, i32 1, i64 128, i64 64, i64 0, i32 0, null, metadata !11, i32 0, null} ; [ DW_TAG_structure_type ]
44 !11 = metadata !{metadata !12, metadata !13}
45 !12 = metadata !{i32 524301, metadata !10, metadata !"x", metadata !2, i32 2, i64 64, i64 64, i64 0, i32 0, metadata !6} ; [ DW_TAG_member ]
46 !13 = metadata !{i32 524301, metadata !10, metadata !"y", metadata !2, i32 3, i64 64, i64 64, i64 64, i32 0, metadata !6} ; [ DW_TAG_member ]
47 !14 = metadata !{i32 524301, metadata !7, metadata !"P2", metadata !2, i32 8, i64 128, i64 64, i64 128, i32 0, metadata !10} ; [ DW_TAG_member ]
48 !15 = metadata !{i32 11, i32 0, metadata !1, null}
49 !16 = metadata !{i32 12, i32 0, metadata !17, null}
50 !17 = metadata !{i32 524299, metadata !1, i32 11, i32 0} ; [ DW_TAG_lexical_block ]