1 ; RUN: llc < %s | FileCheck %s
3 ; Make sure we check that forwarded memory arguments are not modified when tail
4 ; calling. inalloca and copy arg elimination make argument slots mutable.
6 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
7 target triple = "i386-pc-windows-msvc19.0.24215"
9 declare x86_stdcallcc void @tail_std(i32)
10 declare void @capture(i32*)
12 define x86_thiscallcc void @inalloca(i32* %this, i32* inalloca %args) {
14 %val = load i32, i32* %args
15 store i32 0, i32* %args
16 tail call x86_stdcallcc void @tail_std(i32 %val)
20 ; CHECK-LABEL: _inalloca: # @inalloca
21 ; CHECK: movl 4(%esp), %[[reg:[^ ]*]]
22 ; CHECK: movl $0, 4(%esp)
23 ; CHECK: pushl %[[reg]]
24 ; CHECK: calll _tail_std@4
27 define x86_stdcallcc void @copy_elide(i32 %arg) {
30 store i32 %arg, i32* %arg.ptr
31 call void @capture(i32* %arg.ptr)
32 tail call x86_stdcallcc void @tail_std(i32 %arg)
36 ; CHECK-LABEL: _copy_elide@4: # @copy_elide
37 ; CHECK: leal {{[0-9]+}}(%esp), %[[reg:[^ ]*]]
38 ; CHECK: pushl %[[reg]]
39 ; CHECK: calll _capture
41 ; CHECK: calll _tail_std@4