aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-05-07 20:34:00 +0000
committerDevang Patel <dpatel@apple.com>2010-05-07 20:34:00 +0000
commit735538b3eb0bc32bc71fabedea169c7520e5affa (patch)
tree315ec2f7ddb6694c6ad873788c38d19b7829bebc
parentebe57f1b30870d46b48bf3bb22d7a88c780e9848 (diff)
Update test to use valid debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103287 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/Mem2Reg/ConvertDebugInfo.ll61
1 files changed, 37 insertions, 24 deletions
diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
index a013a1db99..37d27d4cb6 100644
--- a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
+++ b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
@@ -1,32 +1,45 @@
; RUN: opt < %s -mem2reg -S | FileCheck %s
-target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
-
-define double @testfunc(i32 %i, double %j) {
- %I = alloca i32 ; <i32*> [#uses=4]
- call void @llvm.dbg.declare(metadata !{i32* %I}, metadata !0)
- %J = alloca double ; <double*> [#uses=2]
- call void @llvm.dbg.declare(metadata !{double* %J}, metadata !1)
+define double @testfunc(i32 %i, double %j) nounwind ssp {
+entry:
+ %i_addr = alloca i32 ; <i32*> [#uses=2]
+ %j_addr = alloca double ; <double*> [#uses=2]
+ %retval = alloca double ; <double*> [#uses=2]
+ %0 = alloca double ; <double*> [#uses=2]
+ %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
+ call void @llvm.dbg.declare(metadata !{i32* %i_addr}, metadata !0), !dbg !8
; CHECK: call void @llvm.dbg.value(metadata !{i32 %i}, i64 0, metadata !0)
- store i32 %i, i32* %I
-; CHECK: call void @llvm.dbg.value(metadata !{double %j}, i64 0, metadata !1), !dbg !3
- store double %j, double* %J, !dbg !3
- %t1 = load i32* %I ; <i32> [#uses=1]
- %t2 = add i32 %t1, 1 ; <i32> [#uses=1]
- store i32 %t2, i32* %I
- %t3 = load i32* %I ; <i32> [#uses=1]
- %t4 = sitofp i32 %t3 to double ; <double> [#uses=1]
- %t5 = load double* %J ; <double> [#uses=1]
- %t6 = fmul double %t4, %t5 ; <double> [#uses=1]
- ret double %t6
+; CHECK: call void @llvm.dbg.value(metadata !{double %j}, i64 0, metadata !8)
+ store i32 %i, i32* %i_addr
+ call void @llvm.dbg.declare(metadata !{double* %j_addr}, metadata !9), !dbg !8
+ store double %j, double* %j_addr
+ %1 = load i32* %i_addr, align 4, !dbg !10 ; <i32> [#uses=1]
+ %2 = add nsw i32 %1, 1, !dbg !10 ; <i32> [#uses=1]
+ %3 = sitofp i32 %2 to double, !dbg !10 ; <double> [#uses=1]
+ %4 = load double* %j_addr, align 8, !dbg !10 ; <double> [#uses=1]
+ %5 = fadd double %3, %4, !dbg !10 ; <double> [#uses=1]
+ store double %5, double* %0, align 8, !dbg !10
+ %6 = load double* %0, align 8, !dbg !10 ; <double> [#uses=1]
+ store double %6, double* %retval, align 8, !dbg !10
+ br label %return, !dbg !10
+
+return: ; preds = %entry
+ %retval1 = load double* %retval, !dbg !10 ; <double> [#uses=1]
+ ret double %retval1, !dbg !10
}
declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
-!bar = !{!0}
-!foo = !{!2}
+!0 = metadata !{i32 524545, metadata !1, metadata !"i", metadata !2, i32 2, metadata !7} ; [ DW_TAG_arg_variable ]
+!1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"testfunc", metadata !"testfunc", metadata !"testfunc", metadata !2, i32 2, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false, i1 false} ; [ DW_TAG_subprogram ]
+!2 = metadata !{i32 524329, metadata !"testfunc.c", metadata !"/tmp", metadata !3} ; [ DW_TAG_file_type ]
+!3 = metadata !{i32 524305, i32 0, i32 1, metadata !"testfunc.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 ]
+!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 ]
+!5 = metadata !{metadata !6, metadata !7, metadata !6}
+!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 ]
+!7 = 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 ]
+!8 = metadata !{i32 2, i32 0, metadata !1, null}
+!9 = metadata !{i32 524545, metadata !1, metadata !"j", metadata !2, i32 2, metadata !6} ; [ DW_TAG_arg_variable ]
+!10 = metadata !{i32 3, i32 0, metadata !11, null}
+!11 = metadata !{i32 524299, metadata !1, i32 2, i32 0} ; [ DW_TAG_lexical_block ]
-!0 = metadata !{i32 459008, metadata !1, metadata !"foo", metadata !2, i32 5, metadata !"foo"} ; [ DW_TAG_auto_variable ]
-!1 = metadata !{i32 459008, metadata !1, metadata !"foo", metadata !0, i32 5, metadata !1} ; [ DW_TAG_auto_variable ]
-!2 = metadata !{i32 458804, i32 0, metadata !2, metadata !"foo", metadata !"bar", metadata !"bar", metadata !2, i32 3, metadata !0, i1 false, i1 true} ; [ DW_TAG_variable ]
-!3 = metadata !{i32 4, i32 0, metadata !0, null}