2013-07-29 22:18:19 +02:00
; RUN: llc -O0 -mtriple=arm-apple-darwin < %s | grep DW_OP_breg
2011-04-28 04:22:40 +02:00
; Use DW_OP_breg in variable's location expression if the variable is in a stack slot.
2010-08-04 20:42:46 +02:00
%struct.SVal = type { i8 * , i32 }
define i32 @_Z3fooi4SVal ( i32 %i , %struct.SVal * noalias %location ) nounwind ssp {
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @llvm.dbg.value ( metadata ! { i32 %i } , i64 0 , metadata !23 ) , !dbg !24
call void @llvm.dbg.value ( metadata ! { %struct.SVal * %location } , i64 0 , metadata !25 ) , !dbg !24
%0 = icmp ne i32 %i , 0 , !dbg !27 ; <i1> [#uses=1]
br i1 %0 , label %bb , label %bb1 , !dbg !27
bb: ; preds = %entry
%1 = getelementptr inbounds %struct.SVal * %location , i32 0 , i32 1 , !dbg !29 ; <i32*> [#uses=1]
%2 = load i32 * %1 , align 8 , !dbg !29 ; <i32> [#uses=1]
%3 = add i32 %2 , %i , !dbg !29 ; <i32> [#uses=1]
br label %bb2 , !dbg !29
bb1: ; preds = %entry
%4 = getelementptr inbounds %struct.SVal * %location , i32 0 , i32 1 , !dbg !30 ; <i32*> [#uses=1]
%5 = load i32 * %4 , align 8 , !dbg !30 ; <i32> [#uses=1]
%6 = sub i32 %5 , 1 , !dbg !30 ; <i32> [#uses=1]
br label %bb2 , !dbg !30
bb2: ; preds = %bb1, %bb
%.0 = phi i32 [ %3 , %bb ] , [ %6 , %bb1 ] ; <i32> [#uses=1]
br label %return , !dbg !29
return: ; preds = %bb2
ret i32 %.0 , !dbg !29
}
2011-06-17 05:14:27 +02:00
define linkonce_odr void @_ZN4SValC1Ev ( %struct.SVal * %this ) nounwind ssp align 2 {
2010-08-04 20:42:46 +02:00
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @llvm.dbg.value ( metadata ! { %struct.SVal * %this } , i64 0 , metadata !31 ) , !dbg !34
%0 = getelementptr inbounds %struct.SVal * %this , i32 0 , i32 0 , !dbg !34 ; <i8**> [#uses=1]
store i8 * null , i8 * * %0 , align 8 , !dbg !34
%1 = getelementptr inbounds %struct.SVal * %this , i32 0 , i32 1 , !dbg !34 ; <i32*> [#uses=1]
store i32 0 , i32 * %1 , align 8 , !dbg !34
br label %return , !dbg !34
return: ; preds = %entry
ret void , !dbg !35
}
declare void @llvm.dbg.declare ( metadata , metadata ) nounwind readnone
define i32 @main ( ) nounwind ssp {
entry:
%0 = alloca %struct.SVal ; <%struct.SVal*> [#uses=3]
%v = alloca %struct.SVal ; <%struct.SVal*> [#uses=4]
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
call void @llvm.dbg.declare ( metadata ! { %struct.SVal * %v } , metadata !38 ) , !dbg !41
call void @_ZN4SValC1Ev ( %struct.SVal * %v ) nounwind , !dbg !41
%1 = getelementptr inbounds %struct.SVal * %v , i32 0 , i32 1 , !dbg !42 ; <i32*> [#uses=1]
store i32 1 , i32 * %1 , align 8 , !dbg !42
%2 = getelementptr inbounds %struct.SVal * %0 , i32 0 , i32 0 , !dbg !43 ; <i8**> [#uses=1]
%3 = getelementptr inbounds %struct.SVal * %v , i32 0 , i32 0 , !dbg !43 ; <i8**> [#uses=1]
%4 = load i8 * * %3 , align 8 , !dbg !43 ; <i8*> [#uses=1]
store i8 * %4 , i8 * * %2 , align 8 , !dbg !43
%5 = getelementptr inbounds %struct.SVal * %0 , i32 0 , i32 1 , !dbg !43 ; <i32*> [#uses=1]
%6 = getelementptr inbounds %struct.SVal * %v , i32 0 , i32 1 , !dbg !43 ; <i32*> [#uses=1]
%7 = load i32 * %6 , align 8 , !dbg !43 ; <i32> [#uses=1]
store i32 %7 , i32 * %5 , align 8 , !dbg !43
%8 = call i32 @_Z3fooi4SVal ( i32 2 , %struct.SVal * noalias %0 ) nounwind , !dbg !43 ; <i32> [#uses=0]
call void @llvm.dbg.value ( metadata ! { i32 %8 } , i64 0 , metadata !44 ) , !dbg !43
br label %return , !dbg !45
return: ; preds = %entry
ret i32 0 , !dbg !45
}
declare void @llvm.dbg.value ( metadata , i64 , metadata ) nounwind readnone
2013-03-08 01:23:31 +01:00
!llvm.dbg.cu = ! { !3 }
2010-08-04 20:42:46 +02:00
2013-07-24 03:26:37 +02:00
!0 = metadata ! { i32 786478 , metadata !48 , metadata !1 , metadata !"SVal" , metadata !"SVal" , metadata !"" , i32 11 , metadata !14 , i1 false , i1 false , i32 0 , i32 0 , null , i1 false , i1 false , null , null , null , null , i32 0 } ; [ DW_TAG_subprogram ]
2013-08-27 00:39:55 +02:00
!1 = metadata ! { i32 786451 , metadata !48 , null , metadata !"SVal" , i32 1 , i64 128 , i64 64 , i64 0 , i32 0 , null , metadata !4 , i32 0 , null , null , null } ; [ DW_TAG_structure_type ] [SVal] [line 1, size 128, align 64, offset 0] [def] [from ]
2013-03-28 03:44:59 +01:00
!2 = metadata ! { i32 786473 , metadata !48 } ; [ DW_TAG_file_type ]
2013-07-27 03:26:08 +02:00
!3 = metadata ! { i32 786449 , metadata !48 , i32 4 , metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)" , i1 false , metadata !"" , i32 0 , metadata !47 , metadata !47 , metadata !46 , metadata !47 , metadata !47 , metadata !"" } ; [ DW_TAG_compile_unit ]
2010-08-04 20:42:46 +02:00
!4 = metadata ! { metadata !5 , metadata !7 , metadata !0 , metadata !9 }
2013-07-24 03:26:37 +02:00
!5 = metadata ! { i32 786445 , metadata !48 , metadata !1 , metadata !"Data" , i32 7 , i64 64 , i64 64 , i64 0 , i32 0 , metadata !6 } ; [ DW_TAG_member ]
!6 = metadata ! { i32 786447 , metadata !48 , null , metadata !"" , i32 0 , i64 64 , i64 64 , i64 0 , i32 0 , null } ; [ DW_TAG_pointer_type ]
!7 = metadata ! { i32 786445 , metadata !48 , metadata !1 , metadata !"Kind" , i32 8 , i64 32 , i64 32 , i64 64 , i32 0 , metadata !8 } ; [ DW_TAG_member ]
!8 = metadata ! { i32 786468 , metadata !48 , null , metadata !"unsigned int" , i32 0 , i64 32 , i64 32 , i64 0 , i32 0 , i32 7 } ; [ DW_TAG_base_type ]
!9 = metadata ! { i32 786478 , metadata !48 , metadata !1 , metadata !"~SVal" , metadata !"~SVal" , metadata !"" , i32 12 , metadata !10 , i1 false , i1 false , i32 0 , i32 0 , null , i1 false , i1 false , null , null , null , null , i32 0 } ; [ DW_TAG_subprogram ]
2013-08-27 00:39:55 +02:00
!10 = metadata ! { i32 786453 , metadata !48 , 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 ]
2010-08-04 20:42:46 +02:00
!11 = metadata ! { null , metadata !12 , metadata !13 }
2013-07-24 03:26:37 +02:00
!12 = metadata ! { i32 786447 , metadata !48 , null , metadata !"" , i32 0 , i64 64 , i64 64 , i64 0 , i32 64 , metadata !1 } ; [ DW_TAG_pointer_type ]
!13 = metadata ! { i32 786468 , metadata !48 , null , metadata !"int" , i32 0 , i64 32 , i64 32 , i64 0 , i32 0 , i32 5 } ; [ DW_TAG_base_type ]
2013-08-27 00:39:55 +02:00
!14 = metadata ! { i32 786453 , metadata !48 , null , metadata !"" , i32 0 , i64 0 , i64 0 , i64 0 , i32 0 , null , metadata !15 , i32 0 , null , null , null } ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
2010-08-04 20:42:46 +02:00
!15 = metadata ! { null , metadata !12 }
2013-07-24 03:26:37 +02:00
!16 = metadata ! { i32 786478 , metadata !48 , metadata !1 , metadata !"SVal" , metadata !"SVal" , metadata !"_ZN4SValC1Ev" , i32 11 , metadata !14 , i1 false , i1 true , i32 0 , i32 0 , null , i1 false , i1 false , void ( %struct.SVal * ) * @_ZN4SValC1Ev , null , null , null , i32 0 } ; [ DW_TAG_subprogram ]
2013-07-27 03:26:08 +02:00
!17 = metadata ! { i32 786478 , metadata !48 , metadata !2 , metadata !"foo" , metadata !"foo" , metadata !"_Z3fooi4SVal" , i32 16 , metadata !18 , i1 false , i1 true , i32 0 , i32 0 , null , i1 false , i1 false , i32 ( i32 , %struct.SVal * ) * @_Z3fooi4SVal , null , null , null , i32 0 } ; [ DW_TAG_subprogram ]
2013-08-27 00:39:55 +02:00
!18 = metadata ! { i32 786453 , metadata !48 , null , metadata !"" , i32 0 , i64 0 , i64 0 , i64 0 , i32 0 , null , metadata !19 , i32 0 , null , null , null } ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
2010-08-04 20:42:46 +02:00
!19 = metadata ! { metadata !13 , metadata !13 , metadata !1 }
2013-07-27 03:26:08 +02:00
!20 = metadata ! { i32 786478 , metadata !48 , metadata !2 , metadata !"main" , metadata !"main" , metadata !"main" , i32 23 , metadata !21 , i1 false , i1 true , i32 0 , i32 0 , null , i1 false , i1 false , i32 ( ) * @main , null , null , null , i32 0 } ; [ DW_TAG_subprogram ]
2013-08-27 00:39:55 +02:00
!21 = metadata ! { i32 786453 , metadata !48 , null , metadata !"" , i32 0 , i64 0 , i64 0 , i64 0 , i32 0 , null , metadata !22 , i32 0 , null , null , null } ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
2010-08-04 20:42:46 +02:00
!22 = metadata ! { metadata !13 }
2013-03-08 01:23:31 +01:00
!23 = metadata ! { i32 786689 , metadata !17 , metadata !"i" , metadata !2 , i32 16 , metadata !13 , i32 0 , i32 0 } ; [ DW_TAG_arg_variable ]
2010-08-04 20:42:46 +02:00
!24 = metadata ! { i32 16 , i32 0 , metadata !17 , null }
2013-03-08 01:23:31 +01:00
!25 = metadata ! { i32 786689 , metadata !17 , metadata !"location" , metadata !2 , i32 16 , metadata !26 , i32 0 , i32 0 } ; [ DW_TAG_arg_variable ]
2013-07-27 03:26:08 +02:00
!26 = metadata ! { i32 786448 , metadata !48 , metadata !2 , metadata !"SVal" , i32 0 , i64 64 , i64 64 , i64 0 , i32 0 , metadata !1 } ; [ DW_TAG_reference_type ]
2010-08-04 20:42:46 +02:00
!27 = metadata ! { i32 17 , i32 0 , metadata !28 , null }
2013-03-28 03:44:59 +01:00
!28 = metadata ! { i32 786443 , metadata !2 , metadata !17 , i32 16 , i32 0 , i32 2 } ; [ DW_TAG_lexical_block ]
2010-08-04 20:42:46 +02:00
!29 = metadata ! { i32 18 , i32 0 , metadata !28 , null }
!30 = metadata ! { i32 20 , i32 0 , metadata !28 , null }
2013-03-08 01:23:31 +01:00
!31 = metadata ! { i32 786689 , metadata !16 , metadata !"this" , metadata !2 , i32 11 , metadata !32 , i32 0 , i32 0 } ; [ DW_TAG_arg_variable ]
2013-07-27 03:26:08 +02:00
!32 = metadata ! { i32 786470 , metadata !48 , metadata !2 , metadata !"" , i32 0 , i64 64 , i64 64 , i64 0 , i32 64 , metadata !33 } ; [ DW_TAG_const_type ]
!33 = metadata ! { i32 786447 , metadata !48 , metadata !2 , metadata !"" , i32 0 , i64 64 , i64 64 , i64 0 , i32 0 , metadata !1 } ; [ DW_TAG_pointer_type ]
2010-08-04 20:42:46 +02:00
!34 = metadata ! { i32 11 , i32 0 , metadata !16 , null }
!35 = metadata ! { i32 11 , i32 0 , metadata !36 , null }
2013-07-27 03:26:08 +02:00
!36 = metadata ! { i32 786443 , metadata !48 , metadata !37 , i32 11 , i32 0 , i32 1 } ; [ DW_TAG_lexical_block ]
!37 = metadata ! { i32 786443 , metadata !48 , metadata !16 , i32 11 , i32 0 , i32 0 } ; [ DW_TAG_lexical_block ]
2013-03-08 01:23:31 +01:00
!38 = metadata ! { i32 786688 , metadata !39 , metadata !"v" , metadata !2 , i32 24 , metadata !1 , i32 0 , i32 0 } ; [ DW_TAG_auto_variable ]
2013-07-27 03:26:08 +02:00
!39 = metadata ! { i32 786443 , metadata !48 , metadata !40 , i32 23 , i32 0 , i32 4 } ; [ DW_TAG_lexical_block ]
!40 = metadata ! { i32 786443 , metadata !48 , metadata !20 , i32 23 , i32 0 , i32 3 } ; [ DW_TAG_lexical_block ]
2010-08-04 20:42:46 +02:00
!41 = metadata ! { i32 24 , i32 0 , metadata !39 , null }
!42 = metadata ! { i32 25 , i32 0 , metadata !39 , null }
!43 = metadata ! { i32 26 , i32 0 , metadata !39 , null }
2013-03-08 01:23:31 +01:00
!44 = metadata ! { i32 786688 , metadata !39 , metadata !"k" , metadata !2 , i32 26 , metadata !13 , i32 0 , i32 0 } ; [ DW_TAG_auto_variable ]
2010-08-04 20:42:46 +02:00
!45 = metadata ! { i32 27 , i32 0 , metadata !39 , null }
2013-03-08 01:23:31 +01:00
!46 = metadata ! { metadata !0 , metadata !9 , metadata !16 , metadata !17 , metadata !20 }
!47 = metadata ! { i32 0 }
2013-03-17 22:13:55 +01:00
!48 = metadata ! { metadata !"small.cc" , metadata !"/Users/manav/R8248330" }