2009-09-12 02:01:28 +08:00
|
|
|
; RUN: opt < %s -deadargelim -die -S > %t
|
2008-06-25 00:30:26 +08:00
|
|
|
; RUN: cat %t | grep 123
|
|
|
|
|
|
|
|
; This test tries to catch wrongful removal of return values for a specific case
|
2011-05-22 09:16:00 +08:00
|
|
|
; that was breaking llvm-gcc builds.
|
2008-06-25 00:30:26 +08:00
|
|
|
|
|
|
|
; This function has a live return value, it is used by @alive.
|
|
|
|
define internal i32 @test5() {
|
|
|
|
ret i32 123
|
|
|
|
}
|
|
|
|
|
|
|
|
; This function doesn't use the return value @test5 and tries to lure DAE into
|
|
|
|
; marking @test5's return value dead because only this call is unused.
|
|
|
|
define i32 @dead() {
|
|
|
|
%DEAD = call i32 @test5()
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
; This function ensures the retval of @test5 is live.
|
|
|
|
define i32 @alive() {
|
|
|
|
%LIVE = call i32 @test5()
|
|
|
|
ret i32 %LIVE
|
|
|
|
}
|