1; RUN: opt < %s -deadargelim -dce -S > %t
2; RUN: cat %t | grep 123
3
4; This test tries to catch wrongful removal of return values for a specific case
5; that was breaking llvm-gcc builds.
6
7; This function has a live return value, it is used by @alive.
8define internal i32 @test5() {
9  ret i32 123
10}
11
12; This function doesn't use the return value @test5 and tries to lure DAE into
13; marking @test5's return value dead because only this call is unused.
14define i32 @dead() {
15  %DEAD = call i32 @test5()
16  ret i32 0
17}
18
19; This function ensures the retval of @test5 is live.
20define i32 @alive() {
21  %LIVE = call i32 @test5()
22  ret i32 %LIVE
23}
24