1 ; RUN: opt -deadargelim -S %s | FileCheck %s
3 define void @test(i32) {
14 define void @f(i32 %X) {
16 tail call void @sideeffect() nounwind
20 declare void @sideeffect()
22 define void @g(i32 %n) {
24 %add = add nsw i32 %n, 1
25 ; CHECK: tail call void @f(i32 undef)
26 tail call void @f(i32 %add)
32 %i = alloca i32, align 4
33 volatile store i32 10, i32* %i, align 4
34 ; CHECK: %tmp = volatile load i32* %i, align 4
35 ; CHECK-next: call void @f(i32 undef)
36 %tmp = volatile load i32* %i, align 4
37 call void @f(i32 %tmp)
41 ; Check that callers are not transformed for weak definitions.
42 define weak i32 @weak_f(i32 %x) nounwind {
46 define void @weak_f_caller() nounwind {
48 ; CHECK: call i32 @weak_f(i32 10)
49 %call = tail call i32 @weak_f(i32 10)