Devang Patel | 9d904e1 | 2011-09-08 22:59:09 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
| 2 | ; Test to check argument y's debug info uses FI |
| 3 | ; Radar 10048772 |
| 4 | target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32" |
Evan Cheng | 801d98b | 2012-01-04 01:55:04 +0000 | [diff] [blame] | 5 | target triple = "thumbv7-apple-ios" |
Devang Patel | 9d904e1 | 2011-09-08 22:59:09 +0000 | [diff] [blame] | 6 | |
| 7 | %struct.tag_s = type { i32, i32, i32 } |
| 8 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 9 | define void @foo(%struct.tag_s* nocapture %this, %struct.tag_s* %c, i64 %x, i64 %y, %struct.tag_s* nocapture %ptr1, %struct.tag_s* nocapture %ptr2) nounwind ssp !dbg !1 { |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 10 | tail call void @llvm.dbg.value(metadata %struct.tag_s* %this, i64 0, metadata !5, metadata !DIExpression()), !dbg !20 |
| 11 | tail call void @llvm.dbg.value(metadata %struct.tag_s* %c, i64 0, metadata !13, metadata !DIExpression()), !dbg !21 |
| 12 | tail call void @llvm.dbg.value(metadata i64 %x, i64 0, metadata !14, metadata !DIExpression()), !dbg !22 |
| 13 | tail call void @llvm.dbg.value(metadata i64 %y, i64 0, metadata !17, metadata !DIExpression()), !dbg !23 |
Dan Gohman | 7aa4aba | 2015-11-17 16:01:28 +0000 | [diff] [blame] | 14 | ;CHECK: @DEBUG_VALUE: foo:y <- [%R7+8] |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 15 | tail call void @llvm.dbg.value(metadata %struct.tag_s* %ptr1, i64 0, metadata !18, metadata !DIExpression()), !dbg !24 |
| 16 | tail call void @llvm.dbg.value(metadata %struct.tag_s* %ptr2, i64 0, metadata !19, metadata !DIExpression()), !dbg !25 |
Devang Patel | 9d904e1 | 2011-09-08 22:59:09 +0000 | [diff] [blame] | 17 | %1 = icmp eq %struct.tag_s* %c, null, !dbg !26 |
| 18 | br i1 %1, label %3, label %2, !dbg !26 |
| 19 | |
| 20 | ; <label>:2 ; preds = %0 |
| 21 | tail call void @foobar(i64 %x, i64 %y) nounwind, !dbg !28 |
| 22 | br label %3, !dbg !28 |
| 23 | |
| 24 | ; <label>:3 ; preds = %0, %2 |
| 25 | ret void, !dbg !29 |
| 26 | } |
| 27 | |
| 28 | declare void @foobar(i64, i64) |
| 29 | |
Adrian Prantl | 87b7eb9 | 2014-10-01 18:55:02 +0000 | [diff] [blame] | 30 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone |
Devang Patel | 9d904e1 | 2011-09-08 22:59:09 +0000 | [diff] [blame] | 31 | |
| 32 | !llvm.dbg.cu = !{!0} |
Manman Ren | 409558f | 2013-11-22 21:49:45 +0000 | [diff] [blame] | 33 | !llvm.module.flags = !{!33} |
Devang Patel | 9d904e1 | 2011-09-08 22:59:09 +0000 | [diff] [blame] | 34 | |
Adrian Prantl | 75819ae | 2016-04-15 15:57:41 +0000 | [diff] [blame] | 35 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-211.10.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: FullDebug, file: !32, enums: !{}, retainedTypes: !{}, imports: null) |
| 36 | !1 = distinct !DISubprogram(name: "foo", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 11, file: !2, scope: !2, type: !3, variables: !31) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 37 | !2 = !DIFile(filename: "one.c", directory: "/Volumes/Athwagate/R10048772") |
| 38 | !3 = !DISubroutineType(types: !4) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 39 | !4 = !{null} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 40 | !5 = !DILocalVariable(name: "this", line: 11, arg: 1, scope: !1, file: !2, type: !6) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 41 | !6 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !0, baseType: !7) |
| 42 | !7 = !DICompositeType(tag: DW_TAG_structure_type, name: "tag_s", line: 5, size: 96, align: 32, file: !32, scope: !0, elements: !8) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 43 | !8 = !{!9, !11, !12} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 44 | !9 = !DIDerivedType(tag: DW_TAG_member, name: "x", line: 6, size: 32, align: 32, file: !32, scope: !7, baseType: !10) |
| 45 | !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 46 | !11 = !DIDerivedType(tag: DW_TAG_member, name: "y", line: 7, size: 32, align: 32, offset: 32, file: !32, scope: !7, baseType: !10) |
| 47 | !12 = !DIDerivedType(tag: DW_TAG_member, name: "z", line: 8, size: 32, align: 32, offset: 64, file: !32, scope: !7, baseType: !10) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 48 | !13 = !DILocalVariable(name: "c", line: 11, arg: 2, scope: !1, file: !2, type: !6) |
| 49 | !14 = !DILocalVariable(name: "x", line: 11, arg: 3, scope: !1, file: !2, type: !15) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 50 | !15 = !DIDerivedType(tag: DW_TAG_typedef, name: "UInt64", line: 1, file: !32, scope: !0, baseType: !16) |
| 51 | !16 = !DIBasicType(tag: DW_TAG_base_type, name: "long long unsigned int", size: 64, align: 32, encoding: DW_ATE_unsigned) |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 52 | !17 = !DILocalVariable(name: "y", line: 11, arg: 4, scope: !1, file: !2, type: !15) |
| 53 | !18 = !DILocalVariable(name: "ptr1", line: 11, arg: 5, scope: !1, file: !2, type: !6) |
| 54 | !19 = !DILocalVariable(name: "ptr2", line: 11, arg: 6, scope: !1, file: !2, type: !6) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 55 | !20 = !DILocation(line: 11, column: 24, scope: !1) |
| 56 | !21 = !DILocation(line: 11, column: 44, scope: !1) |
| 57 | !22 = !DILocation(line: 11, column: 54, scope: !1) |
| 58 | !23 = !DILocation(line: 11, column: 64, scope: !1) |
| 59 | !24 = !DILocation(line: 11, column: 81, scope: !1) |
| 60 | !25 = !DILocation(line: 11, column: 101, scope: !1) |
| 61 | !26 = !DILocation(line: 12, column: 3, scope: !27) |
| 62 | !27 = distinct !DILexicalBlock(line: 11, column: 107, file: !2, scope: !1) |
| 63 | !28 = !DILocation(line: 13, column: 5, scope: !27) |
| 64 | !29 = !DILocation(line: 14, column: 1, scope: !27) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 65 | !31 = !{!5, !13, !14, !17, !18, !19} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 66 | !32 = !DIFile(filename: "one.c", directory: "/Volumes/Athwagate/R10048772") |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 67 | !33 = !{i32 1, !"Debug Info Version", i32 3} |