[llvm-commits] [llvm] r164617 - /llvm/trunk/test/Transforms/DeadStoreElimination/libcalls.ll

Nick Lewycky nicholas at mxc.ca
Tue Sep 25 11:17:38 PDT 2012


Author: nicholas
Date: Tue Sep 25 13:17:38 2012
New Revision: 164617

URL: http://llvm.org/viewvc/llvm-project?rev=164617&view=rev
Log:
Make this test check the transforms it's actually doing. Also add a test that it
doesn't transform the trivially unsafe case.

Modified:
    llvm/trunk/test/Transforms/DeadStoreElimination/libcalls.ll

Modified: llvm/trunk/test/Transforms/DeadStoreElimination/libcalls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/DeadStoreElimination/libcalls.ll?rev=164617&r1=164616&r2=164617&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/DeadStoreElimination/libcalls.ll (original)
+++ llvm/trunk/test/Transforms/DeadStoreElimination/libcalls.ll Tue Sep 25 13:17:38 2012
@@ -16,7 +16,7 @@
 ; CHECK: @test2
   %B = alloca [16 x i8]
   %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0
-; CHECK-NOT: @strcpy
+; CHECK-NOT: @strncpy
   %call = call i8* @strncpy(i8* %dest, i8* %src, i32 12)
 ; CHECK: ret void
   ret void
@@ -27,7 +27,7 @@
 ; CHECK: @test3
   %B = alloca [16 x i8]
   %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0
-; CHECK-NOT: @strcpy
+; CHECK-NOT: @strcat
   %call = call i8* @strcat(i8* %dest, i8* %src)
 ; CHECK: ret void
   ret void
@@ -38,7 +38,7 @@
 ; CHECK: @test4
   %B = alloca [16 x i8]
   %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0
-; CHECK-NOT: @strcpy
+; CHECK-NOT: @strncat
   %call = call i8* @strncat(i8* %dest, i8* %src, i32 12)
 ; CHECK: ret void
   ret void
@@ -54,3 +54,17 @@
   store i8 97, i8* %arrayidx, align 1
   ret void
 }
+
+declare void @user(i8* %p)
+define void @test6(i8* %src) {
+; CHECK: @test6
+  %B = alloca [16 x i8]
+  %dest = getelementptr inbounds [16 x i8]* %B, i64 0, i64 0
+; CHECK: @strcpy
+  %call = call i8* @strcpy(i8* %dest, i8* %src)
+; CHECK: @user
+  call void @user(i8* %dest)
+; CHECK: ret void
+  ret void
+}
+





More information about the llvm-commits mailing list