46 lines · plain
1; RUN: opt %s -passes=inline -S -o - | FileCheck %s2 3;; $ cat test.cpp4;; int g;5;; [[clang::always_inline, gnu::nodebug]] void a() { g = 1; }6;; void b() { a(); }7;;8;; Check the inlined instructions don't inherit the call's atom info.9;; FIXME: Perhaps we want to do actually do that, to preserve existing10;; behaviour? Unclear what's best.11 12; CHECK: _Z1bv()13; CHECK: store i32 1, ptr @g, align 4, !dbg [[DBG:!.*]]14 15; CHECK: distinct !DISubprogram(name: "b", {{.*}}keyInstructions: true)16; CHECK: [[DBG]] = !DILocation(line: 3, scope: ![[#]])17 18@g = hidden global i32 0, align 419 20define hidden void @_Z1av() {21entry:22 store i32 1, ptr @g, align 423 ret void24}25 26define hidden void @_Z1bv() !dbg !15 {27entry:28 call void @_Z1av(), !dbg !1829 ret void, !dbg !1930}31 32!llvm.dbg.cu = !{!0}33!llvm.module.flags = !{!2, !3}34!llvm.ident = !{!10}35 36!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_17, file: !1, producer: "clang version 19.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)37!1 = !DIFile(filename: "test.cpp", directory: "/")38!2 = !{i32 7, !"Dwarf Version", i32 5}39!3 = !{i32 2, !"Debug Info Version", i32 3}40!10 = !{!"clang version 19.0.0"}41!15 = distinct !DISubprogram(name: "b", scope: !1, file: !1, line: 3, type: !16, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, keyInstructions: true)42!16 = !DISubroutineType(types: !17)43!17 = !{}44!18 = !DILocation(line: 3, scope: !15, atomGroup: 1, atomRank: 1)45!19 = !DILocation(line: 3, scope: !15, atomGroup: 2, atomRank: 1)46