|
| 1 | +; RUN: %llc_dwarf -filetype=obj -O0 %s -o - | llvm-dwarfdump -debug-info - | FileCheck %s |
| 2 | + |
| 3 | +; Check that DW_AT_abstract_origin is generated for concrete lexical block. |
| 4 | + |
| 5 | +; Generated from: |
| 6 | +; inline __attribute__((always_inline)) int foo(int x) { |
| 7 | +; { |
| 8 | +; int y = x + 5; |
| 9 | +; return y - 10; |
| 10 | +; } |
| 11 | +; } |
| 12 | +; |
| 13 | +; int bar(int x) { |
| 14 | +; int y = foo(7); |
| 15 | +; return y + 8; |
| 16 | +; } |
| 17 | + |
| 18 | +; CHECK: DW_TAG_subprogram |
| 19 | +; CHECK-NEXT: DW_AT_name ("foo") |
| 20 | +; CHECK-NOT: {{DW_TAG|NULL}} |
| 21 | +; CHECK: [[LB:.*]]: DW_TAG_lexical_block |
| 22 | + |
| 23 | +; CHECK: DW_TAG_inlined_subroutine |
| 24 | +; CHECK-NEXT: DW_AT_abstract_origin {{.*}} "foo" |
| 25 | +; CHECK-NOT: {{DW_TAG|NULL}} |
| 26 | +; CHECK: DW_TAG_lexical_block |
| 27 | +; CHECK-NOT: {{DW_TAG|NULL}} |
| 28 | +; CHECK: DW_AT_abstract_origin {{.*}}[[LB]] |
| 29 | + |
| 30 | +target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32" |
| 31 | +target triple = "arm64-apple-macosx15.0.0" |
| 32 | + |
| 33 | +define i32 @bar() !dbg !9 { |
| 34 | +entry: |
| 35 | + %y.i = alloca i32, align 4 |
| 36 | + #dbg_declare(ptr %y.i, !22, !DIExpression(), !24) |
| 37 | + store i32 0, ptr %y.i, align 4, !dbg !24 |
| 38 | + %1 = load i32, ptr %y.i, align 4 |
| 39 | + ret i32 %1 |
| 40 | +} |
| 41 | + |
| 42 | +!llvm.dbg.cu = !{!0} |
| 43 | +!llvm.module.flags = !{!3} |
| 44 | + |
| 45 | +!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, emissionKind: FullDebug) |
| 46 | +!1 = !DIFile(filename: "test.c", directory: "") |
| 47 | +!3 = !{i32 2, !"Debug Info Version", i32 3} |
| 48 | +!9 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 8, type: !10, spFlags: DISPFlagDefinition, unit: !0) |
| 49 | +!10 = !DISubroutineType(types: !13) |
| 50 | +!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 51 | +!13 = !{} |
| 52 | +!19 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !10, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0) |
| 53 | +!21 = distinct !DILocation(line: 9, column: 11, scope: !9) |
| 54 | +!22 = !DILocalVariable(name: "y", scope: !23, file: !1, line: 3, type: !12) |
| 55 | +!23 = distinct !DILexicalBlock(scope: !19, file: !1, line: 2, column: 3) |
| 56 | +!24 = !DILocation(line: 3, column: 9, scope: !23, inlinedAt: !21) |
0 commit comments