IR: Give 'DI' prefix to debug info metadata
[oota-llvm.git] / test / Transforms / DeadArgElim / keepalive.ll
index dc92dc9f171aa871b7e8ee01b96b0cf38e34b227..d8a09933dcf9387ca3d239bbd1abb4a724931d19 100644 (file)
@@ -1,6 +1,4 @@
-; RUN: opt < %s -deadargelim -S > %t
-; RUN: grep "define internal zeroext i32 @test1() nounwind" %t
-; RUN: grep "define internal <{ i32, i32 }> @test2" %t
+; RUN: opt < %s -deadargelim -S | FileCheck %s
 
 %Ty = type <{ i32, i32 }>
 
@@ -9,11 +7,13 @@
 ; the function and then changing too much.
 
 ; This checks if the return value attributes are not removed
+; CHECK: define internal zeroext i32 @test1() #0
 define internal zeroext i32 @test1(i32 %DEADARG1) nounwind {
         ret i32 1
 }
 
 ; This checks if the struct doesn't get non-packed
+; CHECK-LABEL: define internal <{ i32, i32 }> @test2(
 define internal <{ i32, i32 }> @test2(i32 %DEADARG1) {
         ret <{ i32, i32 }> <{ i32 1, i32 2 }>
 }
@@ -28,3 +28,20 @@ define void @caller() {
         ret void
 }
 
+; We can't remove 'this' here, as that would put argmem in ecx instead of
+; memory.
+define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca %argmem) {
+       %v = load i32, i32* %argmem
+       ret i32 %v
+}
+; CHECK-LABEL: define internal x86_thiscallcc i32 @unused_this(i32* %this, i32* inalloca %argmem)
+
+define i32 @caller2() {
+       %t = alloca i32
+       %m = alloca inalloca i32
+       store i32 42, i32* %m
+       %v = call x86_thiscallcc i32 @unused_this(i32* %t, i32* inalloca %m)
+       ret i32 %v
+}
+
+; CHECK: attributes #0 = { nounwind }