1 ; RUN: llvm-as < %s | opt -deadargelim | llvm-dis > %t
2 ; RUN: cat %t | grep {define internal zeroext i32 @test1() nounwind}
3 ; RUN: cat %t | grep {define internal \<\{ i32, i32 \}\> @test}
5 ; Check if the pass doesn't modify anything that doesn't need changing. We feed
6 ; an unused argument to each function to lure it into changing _something_ about
7 ; the function and then changing too much.
9 ; This checks if the return value attributes are not removed
10 define internal zeroext i32 @test1(i32 %DEADARG1) nounwind {
14 ; This checks if the struct doesn't get non-packed
15 define internal <{ i32, i32 }> @test2(i32 %DEADARG1) {
16 ret <{ i32, i32 }> <{ i32 1, i32 2 }>
19 ; We use this external function to make sure the return values don't become dead
20 declare void @user(i32, <{ i32, i32 }>)
22 define void @caller() {
23 %B = call i32 @test1(i32 1)
24 %C = call <{ i32, i32 }> @test2(i32 2)
25 call void @user(i32 %B, <{ i32, i32 }> %C)