When removing a function from the function set and adding it to deferred, we
[llvm.git] / test / Transforms / DeadArgElim / canon.ll
blob11cd482b7b2888ed4fb3c0de3c4e7327ca0661ed
1 ; This test shows a few canonicalizations made by deadargelim
2 ; RUN: opt < %s -deadargelim -S > %t
3 ; This test should remove {} and replace it with void
4 ; RUN: cat %t | grep {define internal void @test}
5 ; This test shouls replace the {i32} return value with just i32
6 ; RUN: cat %t | grep {define internal i32 @test2}
8 define internal {} @test() {
9   ret {} undef
12 define internal {i32} @test2() {
13   ret {i32} undef
16 define void @caller() {
17   call {} @test()
18   %X = call {i32} @test2()
19   %Y = extractvalue {i32} %X, 0
20   call void @user(i32 %Y, {i32} %X)
21   ret void
24 declare void @user(i32, {i32})