2016-08-26 21:00:39 +08:00
; RUN: llc < %s -mtriple=thumbv7em-arm-none-eabi -O3
; When using -Oz and -g, this code generated an abort in the ARM load/store optimizer.
%struct.s = type { %struct.s * }
; Function Attrs: minsize nounwind optsize readonly
define %struct.s * @s_idx ( %struct.s * readonly %xl ) local_unnamed_addr #0 !dbg !8 {
entry:
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata %struct.s * %xl , metadata !17 , metadata !18 ) , !dbg !19
2016-08-26 21:00:39 +08:00
br label %while.cond , !dbg !20
while.cond: ; preds = %while.body, %entry
%xl.addr.0 = phi %struct.s * [ %xl , %entry ] , [ %0 , %while.body ]
%tobool = icmp eq %struct.s * %xl.addr.0 , null
br i1 %tobool , label %while.end , label %while.body
while.body: ; preds = %while.cond
%next = getelementptr inbounds %struct.s , %struct.s * %xl.addr.0 , i32 0 , i32 0
%0 = load %struct.s * , %struct.s * * %next , align 4
2017-07-29 04:21:02 +08:00
tail call void @llvm.dbg.value ( metadata %struct.s * %0 , metadata !17 , metadata !18 ) , !dbg !19
2016-08-26 21:00:39 +08:00
br label %while.cond
while.end: ; preds = %while.cond
ret %struct.s * null
}
; Function Attrs: nounwind readnone
2017-07-29 04:21:02 +08:00
declare void @llvm.dbg.value ( metadata , metadata , metadata ) #1
2016-08-26 21:00:39 +08:00
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !3 , !4 , !5 , !6 }
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C 99 , file: !1 , producer: "clang version 4.0.0 " , isOptimized: true , runtimeVersion: 0 , emissionKind: F u l l D e b u g , enums: !2 )
!1 = !DIFile ( filename: "test.c" , directory: "/a/b/c" )
!2 = ! { }
!3 = ! { i32 2 , !"Dwarf Version" , i32 4 }
!4 = ! { i32 2 , !"Debug Info Version" , i32 3 }
!5 = ! { i32 1 , !"wchar_size" , i32 4 }
!6 = ! { i32 1 , !"min_enum_size" , i32 4 }
!7 = ! { !"clang version 4.0.0 " }
!8 = distinct !DISubprogram ( name: "s_idx" , scope: !1 , file: !1 , line: 6 , type: !9 , isLocal: false , isDefinition: true , scopeLine: 7 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , variables: !16 )
!9 = !DISubroutineType ( types: !10 )
!10 = ! { !11 , !11 }
!11 = !DIDerivedType ( tag: D W _ T A G _ t y p e d e f , name: "ezxml_t" , file: !1 , line: 1 , baseType: !12 )
!12 = !DIDerivedType ( tag: D W _ T A G _ p o i n t e r _ type , baseType: !13 , size: 32 , align: 32 )
!13 = distinct !DICompositeType ( tag: D W _ T A G _ s t r u c t u r e _ type , name: "s" , file: !1 , line: 2 , size: 32 , align: 32 , elements: !14 )
!14 = ! { !15 }
!15 = !DIDerivedType ( tag: D W _ T A G _ m e m b e r , name: "next" , scope: !13 , file: !1 , line: 3 , baseType: !11 , size: 32 , align: 32 )
!16 = ! { !17 }
!17 = !DILocalVariable ( name: "xl" , arg: 1 , scope: !8 , file: !1 , line: 6 , type: !11 )
!18 = !DIExpression ( )
!19 = !DILocation ( line: 6 , column: 27 , scope: !8 )
!20 = !DILocation ( line: 8 , column: 5 , scope: !8 )