1 ; RUN: opt -dse -S < %s | FileCheck %s
3 ; Don't eliminate stores to allocas before tail calls to functions that use
4 ; byval. It's correct to mark calls like these as 'tail'. To implement this tail
5 ; call, the backend should copy the bytes from the alloca into the argument area
6 ; before clearing the stack.
8 target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
9 target triple = "i386-unknown-linux-gnu"
11 declare void @g(i32* byval %p)
13 define void @f(i32* byval %x) {
16 %v = load i32, i32* %x
18 tail call void @g(i32* byval %p)
21 ; CHECK-LABEL: define void @f(i32* byval %x)
22 ; CHECK: store i32 %v, i32* %p
23 ; CHECK: tail call void @g(i32* byval %p)