Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 1 | ; RUN: llc -filetype=obj -o %t.o %s |
| 2 | ; RUN: llvm-dwarfdump -debug-dump=info %t.o | FileCheck %s |
| 3 | |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 4 | ; Testcase generated using 'clang -g -O2 -S -emit-llvm' from the following: |
| 5 | ;; void sink(); |
| 6 | ;; static __attribute__((always_inline)) void bar(int a) { sink(); } |
| 7 | ;; void foo() { |
| 8 | ;; bar(0); |
| 9 | ;; bar(0); |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 10 | ;; } |
| 11 | |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 12 | ; Check that we have formal parameters for 'a' in both inlined subroutines. |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 13 | ; CHECK: DW_TAG_inlined_subroutine |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 14 | ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "bar" |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 15 | ; CHECK: DW_TAG_formal_parameter |
| 16 | ; CHECK-NEXT: DW_AT_const_value |
| 17 | ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "a" |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 18 | ; CHECK: DW_TAG_inlined_subroutine |
| 19 | ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "bar" |
| 20 | ; CHECK: DW_TAG_formal_parameter |
| 21 | ; CHECK-NEXT: DW_AT_const_value |
| 22 | ; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "a" |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 23 | |
| 24 | target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" |
| 25 | target triple = "x86_64-apple-darwin" |
| 26 | |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 27 | ; Function Attrs: nounwind ssp uwtable |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 28 | define void @foo() #0 { |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 29 | entry: |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 30 | tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !12, metadata !17) #3, !dbg !18 |
| 31 | tail call void (...)* @sink() #3, !dbg !20 |
| 32 | tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !12, metadata !17) #3, !dbg !21 |
| 33 | tail call void (...)* @sink() #3, !dbg !23 |
| 34 | ret void, !dbg !24 |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 35 | } |
| 36 | |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 37 | declare void @sink(...) #1 |
| 38 | |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 39 | ; Function Attrs: nounwind readnone |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 40 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 41 | |
| 42 | attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" } |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 43 | attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="core2" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 44 | attributes #2 = { nounwind readnone } |
| 45 | attributes #3 = { nounwind } |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 46 | |
| 47 | !llvm.dbg.cu = !{!0} |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 48 | !llvm.module.flags = !{!13, !14, !15} |
| 49 | !llvm.ident = !{!16} |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 50 | |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 51 | !0 = !MDCompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
| 52 | !1 = !MDFile(filename: "t.c", directory: "/Users/dexonsmith/data/llvm/staging/play/inlined-at") |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 53 | !2 = !{} |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 54 | !3 = !{!4, !7} |
| 55 | !4 = !MDSubprogram(name: "foo", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, isOptimized: true, function: void ()* @foo, variables: !2) |
Duncan P. N. Exon Smith | 7bb480d | 2015-04-16 22:27:54 +0000 | [diff] [blame] | 56 | !5 = !MDSubroutineType(types: !6) |
Duncan P. N. Exon Smith | 05f53ae | 2015-04-17 00:18:46 +0000 | [diff] [blame] | 57 | !6 = !{null} |
| 58 | !7 = !MDSubprogram(name: "bar", scope: !1, file: !1, line: 2, type: !8, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, variables: !11) |
| 59 | !8 = !MDSubroutineType(types: !9) |
| 60 | !9 = !{null, !10} |
| 61 | !10 = !MDBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 62 | !11 = !{!12} |
| 63 | !12 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", arg: 1, scope: !7, file: !1, line: 2, type: !10) |
| 64 | !13 = !{i32 2, !"Dwarf Version", i32 2} |
| 65 | !14 = !{i32 2, !"Debug Info Version", i32 3} |
| 66 | !15 = !{i32 1, !"PIC Level", i32 2} |
| 67 | !16 = !{!"clang version 3.7.0 (trunk 235110) (llvm/trunk 235108)"} |
| 68 | !17 = !MDExpression() |
| 69 | !18 = !MDLocation(line: 2, column: 52, scope: !7, inlinedAt: !19) |
| 70 | !19 = distinct !MDLocation(line: 4, column: 3, scope: !4) |
| 71 | !20 = !MDLocation(line: 2, column: 57, scope: !7, inlinedAt: !19) |
| 72 | !21 = !MDLocation(line: 2, column: 52, scope: !7, inlinedAt: !22) |
| 73 | !22 = distinct !MDLocation(line: 5, column: 3, scope: !4) |
| 74 | !23 = !MDLocation(line: 2, column: 57, scope: !7, inlinedAt: !22) |
| 75 | !24 = !MDLocation(line: 6, column: 1, scope: !4) |