1 ; RUN: opt -S -deadargelim %s | FileCheck %s
3 ; Don't eliminate dead arugments from naked functions.
4 ; CHECK: define internal i32 @naked(i32 %x)
6 define internal i32 @naked(i32 %x) #0 {
7 tail call void asm sideeffect inteldialect "mov eax, [esp + $$4]\0A\09ret", "~{eax},~{dirflag},~{fpsr},~{flags}"()
12 ; Don't eliminate dead varargs from naked functions.
13 ; CHECK: define internal i32 @naked_va(i32 %x, ...)
15 define internal i32 @naked_va(i32 %x, ...) #0 {
16 tail call void asm sideeffect inteldialect "mov eax, [esp + $$8]\0A\09ret", "~{eax},~{dirflag},~{fpsr},~{flags}"()
20 define i32 @f(i32 %x, i32 %y) {
21 %r = call i32 @naked(i32 %x)
22 %s = call i32 (i32, ...) @naked_va(i32 %x, i32 %r)
24 ; Make sure the arguments are still there: not removed or replaced with undef.
25 ; CHECK: %r = call i32 @naked(i32 %x)
26 ; CHECK: %s = call i32 (i32, ...) @naked_va(i32 %x, i32 %r)
31 attributes #0 = { naked }