47 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc %s -o - | FileCheck %s3 4; Previously, we would accidentally leave behind SP adjustments to setup a call5; frame for the musttail call target, and SP adjustments would end up6; 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(ptr nocapture readonly, ptr inalloca(<{ %struct.Args }>))15 16; Function Attrs: nounwind optsize17define dso_local x86_thiscallcc void @methodWithVtorDisp_thunk(ptr %0, ptr inalloca(<{ %struct.Args }>) %1) #0 {18; CHECK-LABEL: methodWithVtorDisp_thunk:19; CHECK: # %bb.0:20; CHECK-NEXT: pushl %esi21; CHECK-NEXT: movl %ecx, %esi22; CHECK-NEXT: subl -4(%ecx), %esi23; CHECK-NEXT: pushl {{[0-9]+}}(%esp)24; CHECK-NEXT: pushl $_methodWithVtorDisp_thunk25; CHECK-NEXT: calll ___cyg_profile_func_exit26; CHECK-NEXT: addl $8, %esp27; CHECK-NEXT: movl %esi, %ecx28; CHECK-NEXT: popl %esi29; CHECK-NEXT: jmp _methodWithVtorDisp # TAILCALL30 %3 = getelementptr inbounds i8, ptr %0, i32 -431 %4 = load i32, ptr %3, align 432 %5 = sub i32 0, %433 %6 = getelementptr i8, ptr %0, i32 %534 %7 = call ptr @llvm.returnaddress(i32 0)35 call void @__cyg_profile_func_exit(ptr @methodWithVtorDisp_thunk, ptr %7)36 musttail call x86_thiscallcc void @methodWithVtorDisp(ptr %6, ptr inalloca(<{ %struct.Args }>) nonnull %1)37 ret void38}39 40declare void @__cyg_profile_func_exit(ptr, ptr)41 42; Function Attrs: nofree nosync nounwind readnone willreturn43declare ptr @llvm.returnaddress(i32 immarg) #144 45attributes #0 = { nounwind optsize }46attributes #1 = { nofree nosync nounwind readnone willreturn }47