Krzysztof Parzyszek | 6dff336 | 2016-08-24 22:36:35 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=hexagon < %s | FileCheck %s |
| 2 | ; Check for some sane output (original problem was a crash). |
| 3 | ; CHECK: DEBUG_VALUE: fred:Count <- 0 |
| 4 | |
| 5 | target triple = "hexagon" |
| 6 | |
| 7 | define i32 @fred(i32 %p) local_unnamed_addr #0 !dbg !6 { |
| 8 | entry: |
| 9 | br label %cond.end |
| 10 | |
| 11 | cond.end: ; preds = %entry |
| 12 | br i1 undef, label %cond.false.i, label %for.body.lr.ph.i |
| 13 | |
| 14 | for.body.lr.ph.i: ; preds = %cond.end |
| 15 | tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !10, metadata !12) #0, !dbg !13 |
| 16 | br label %for.body.i |
| 17 | |
| 18 | cond.false.i: ; preds = %cond.end |
| 19 | unreachable |
| 20 | |
| 21 | for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i |
| 22 | %inc.sink37.i = phi i32 [ 0, %for.body.lr.ph.i ], [ %inc.i, %for.inc.i ] |
| 23 | %call.i = tail call i8* undef(i32 12, i8* undef) #0 |
| 24 | br label %for.inc.i |
| 25 | |
| 26 | for.inc.i: ; preds = %for.body.i |
| 27 | %inc.i = add nuw i32 %inc.sink37.i, 1 |
| 28 | %cmp1.i = icmp ult i32 %inc.i, %p |
| 29 | br i1 %cmp1.i, label %for.body.i, label %PQ_AllocMem.exit.loopexit |
| 30 | |
| 31 | PQ_AllocMem.exit.loopexit: ; preds = %for.inc.i |
| 32 | unreachable |
| 33 | } |
| 34 | |
| 35 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1 |
| 36 | |
| 37 | attributes #0 = { nounwind } |
| 38 | attributes #1 = { nounwind readnone } |
| 39 | |
| 40 | !llvm.dbg.cu = !{!0} |
| 41 | !llvm.module.flags = !{!3, !4} |
| 42 | !llvm.ident = !{!5} |
| 43 | |
| 44 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 37afcb099ac2b001f4c826da7ca1d077b67a508c) (http://llvm.org/git/llvm.git 5887f1c75b3ba216850c834b186efdd3e54b7d4f)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !2) |
| 45 | !1 = !DIFile(filename: "file.c", directory: "/") |
| 46 | !2 = !{} |
| 47 | !3 = !{i32 2, !"Dwarf Version", i32 4} |
| 48 | !4 = !{i32 2, !"Debug Info Version", i32 3} |
| 49 | !5 = !{!"clang version 4.0.0 (http://llvm.org/git/clang.git 37afcb099ac2b001f4c826da7ca1d077b67a508c) (http://llvm.org/git/llvm.git 5887f1c75b3ba216850c834b186efdd3e54b7d4f)"} |
| 50 | !6 = distinct !DISubprogram(name: "fred", scope: !1, file: !1, line: 116, type: !7, isLocal: false, isDefinition: true, scopeLine: 121, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !9) |
| 51 | !7 = !DISubroutineType(types: !2) |
| 52 | !8 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 53 | !9 = !{!10} |
| 54 | !10 = !DILocalVariable(name: "Count", scope: !6, file: !1, line: 1, type: !8) |
| 55 | !11 = distinct !DILocation(line: 1, column: 1, scope: !6) |
| 56 | !12 = !DIExpression() |
| 57 | !13 = !DILocation(line: 1, column: 1, scope: !6, inlinedAt: !11) |