2016-08-25 06:36:35 +08:00
; RUN: llc -march=hexagon < %s | FileCheck %s
; Check for some sane output (original problem was a crash).
; CHECK: DEBUG_VALUE: fred:Count <- 0
target triple = "hexagon"
2018-08-03 06:17:53 +08:00
; Function Attrs: nounwind
define i32 @f0 ( i32 %a0 , i8 * ( i32 , i8 * ) * %a1 ) local_unnamed_addr #0 !dbg !5 {
b0:
br label %b1
b1: ; preds = %b0
call void @llvm.dbg.value ( metadata i32 0 , metadata !8 , metadata !DIExpression ( ) ) , !dbg !10
br label %b2
b2: ; preds = %b3, %b1
%v0 = phi i32 [ 0 , %b1 ] , [ %v2 , %b3 ]
%v1 = tail call i8 * %a1 ( i32 12 , i8 * null ) #0
br label %b3
b3: ; preds = %b2
%v2 = add nuw i32 %v0 , 1
%v3 = icmp ult i32 %v2 , %a0
br i1 %v3 , label %b2 , label %b4
b4: ; preds = %b3
ret i32 0
2016-08-25 06:36:35 +08:00
}
2018-08-03 06:17:53 +08:00
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value ( metadata , metadata , metadata ) #1
2016-08-25 06:36:35 +08:00
attributes #0 = { nounwind }
2018-08-03 06:17:53 +08:00
attributes #1 = { nounwind readnone s p e c u l a t a b l e }
2016-08-25 06:36:35 +08:00
!llvm.dbg.cu = ! { !0 }
!llvm.module.flags = ! { !3 , !4 }
2019-01-16 00:18:52 +08:00
!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 )
2016-08-25 06:36:35 +08:00
!1 = !DIFile ( filename: "file.c" , directory: "/" )
!2 = ! { }
!3 = ! { i32 2 , !"Dwarf Version" , i32 4 }
!4 = ! { i32 2 , !"Debug Info Version" , i32 3 }
2018-08-03 06:17:53 +08:00
!5 = distinct !DISubprogram ( name: "fred" , scope: !1 , file: !1 , line: 116 , type: !6 , isLocal: false , isDefinition: true , scopeLine: 121 , flags: D I F l a g P r o t o t y p e d , isOptimized: true , unit: !0 , retainedNodes: !7 )
!6 = !DISubroutineType ( types: !2 )
!7 = ! { !8 }
!8 = !DILocalVariable ( name: "Count" , scope: !5 , file: !1 , line: 1 , type: !9 )
!9 = !DIBasicType ( name: "int" , size: 32 , align: 32 , encoding: D W _ A T E _ s i g n e d )
!10 = !DILocation ( line: 1 , column: 1 , scope: !5 , inlinedAt: !11 )
!11 = distinct !DILocation ( line: 1 , column: 1 , scope: !5 )