1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc %s -o - | FileCheck %s 3 4; Previously, we would accidentally leave behind SP adjustments to setup a call 5; frame for the musttail call target, and SP adjustments would end up 6; unbalanced. Reported as https://crbug.com/1026882. 7 8target datalayout = "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:32-n8:16:32-a:0:32-S32" 9target triple = "i386-pc-windows-msvc19.16.0" 10 11; 20 bytes of memory. 12%struct.Args = type { i32, i32, i32, i32, i32 } 13 14declare dso_local x86_thiscallcc void @methodWithVtorDisp(i8* nocapture readonly, <{ %struct.Args }>* inalloca) 15 16define dso_local x86_thiscallcc void @methodWithVtorDisp_thunk(i8* %0, <{ %struct.Args }>* inalloca %1) #0 { 17; CHECK-LABEL: methodWithVtorDisp_thunk: 18; CHECK: # %bb.0: 19; CHECK-NEXT: pushl %esi 20; CHECK-NEXT: movl %ecx, %esi 21; CHECK-NEXT: subl -4(%ecx), %esi 22; CHECK-NEXT: pushl {{[0-9]+}}(%esp) 23; CHECK-NEXT: pushl $_methodWithVtorDisp_thunk 24; CHECK-NEXT: calll ___cyg_profile_func_exit 25; CHECK-NEXT: addl $8, %esp 26; CHECK-NEXT: movl %esi, %ecx 27; CHECK-NEXT: popl %esi 28; CHECK-NEXT: jmp _methodWithVtorDisp # TAILCALL 29 %3 = getelementptr inbounds i8, i8* %0, i32 -4 30 %4 = bitcast i8* %3 to i32* 31 %5 = load i32, i32* %4, align 4 32 %6 = sub i32 0, %5 33 %7 = getelementptr i8, i8* %0, i32 %6 34 musttail call x86_thiscallcc void @methodWithVtorDisp(i8* %7, <{ %struct.Args }>* inalloca nonnull %1) 35 ret void 36} 37 38attributes #0 = { nounwind optsize "instrument-function-exit-inlined"="__cyg_profile_func_exit" } 39