# RUN: llc %s --start-after=livedebugvalues -o - --filetype=obj | llvm-dwarfdump - | FileCheck %s ## Check the memory location of the target address for the indirect call ## (virtual in this case) is described by a DW_AT_call_target_clobbered ## expression. # CHECK: DW_TAG_call_site # CHECK-NEXT: DW_AT_call_target_clobbered (DW_OP_breg0 RAX+8) ## Generated from this C++ with llc -stop-after=livedebugvalues -simplify-mir: ## struct Base { ## virtual int zz() { return x; } ## [[clang::noinline]] ## virtual int v() { return zz(); } ## int x; ## }; ## struct Child: public Base { ## [[clang::noinline]] ## virtual int v() { return x * 2; } ## int x; ## }; ## ## [[clang::noinline]] ## [[clang::disable_tail_calls]] ## int foo(Base* b) { ## return b->v(); ## } --- | target triple = "x86_64-unknown-linux-gnu" define dso_local noundef i32 @_Z3fooP4Base(ptr noundef %b) local_unnamed_addr !dbg !5 { entry: %vtable = load ptr, ptr %b, align 8, !dbg !12 %vfn = getelementptr inbounds nuw i8, ptr %vtable, i64 8, !dbg !12 %0 = load ptr, ptr %vfn, align 8, !dbg !12 %call = call noundef i32 %0(ptr noundef nonnull align 8 dereferenceable(12) %b), !dbg !12 ret i32 %call, !dbg !12 } !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!2, !3} !llvm.ident = !{!4} !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 22.0.0git", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) !1 = !DIFile(filename: "test.cpp", directory: "/") !2 = !{i32 7, !"Dwarf Version", i32 5} !3 = !{i32 2, !"Debug Info Version", i32 3} !4 = !{!"clang version 22.0.0git"} !5 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooP4Base", scope: !1, file: !1, line: 15, type: !6, scopeLine: 15, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11, keyInstructions: true) !6 = !DISubroutineType(types: !7) !7 = !{!8, !9} !8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !10, size: 64) !10 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Base", file: !1, line: 1, size: 128, flags: DIFlagFwdDecl | DIFlagNonTrivial, identifier: "_ZTS4Base") !11 = !{} !12 = !DILocation(line: 16, scope: !5) ... --- name: _Z3fooP4Base alignment: 16 tracksRegLiveness: true noPhis: true isSSA: false noVRegs: true hasFakeUses: false debugInstrRef: true tracksDebugUserValues: true liveins: - { reg: '$rdi' } frameInfo: stackSize: 8 offsetAdjustment: -8 maxAlignment: 1 adjustsStack: true hasCalls: true maxCallFrameSize: 0 isCalleeSavedInfoValid: true machineFunctionInfo: amxProgModel: None body: | bb.0.entry: liveins: $rdi frame-setup PUSH64r undef $rax, implicit-def $rsp, implicit $rsp frame-setup CFI_INSTRUCTION def_cfa_offset 16 renamable $rax = MOV64rm renamable $rdi, 1, $noreg, 0, $noreg, debug-location !12 :: (load (s64) from %ir.b) CALL64m killed renamable $rax, 1, $noreg, 8, $noreg, csr_64, implicit $rsp, implicit $ssp, implicit $rdi, implicit-def $rsp, implicit-def $ssp, implicit-def $eax, debug-location !12 :: (load (s64) from %ir.vfn) $rcx = frame-destroy POP64r implicit-def $rsp, implicit $rsp, debug-location !12 frame-destroy CFI_INSTRUCTION def_cfa_offset 8, debug-location !12 RET64 $eax, debug-location !12 ...