[llvm] r321706 - [InstCombine] Add test to remove VarArg casts (NFC)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 05:35:43 PST 2018


Author: fhahn
Date: Wed Jan  3 05:35:43 2018
New Revision: 321706

URL: http://llvm.org/viewvc/llvm-project?rev=321706&view=rev
Log:
[InstCombine] Add test to remove VarArg casts (NFC)


Modified:
    llvm/trunk/test/Transforms/InstCombine/call.ll

Modified: llvm/trunk/test/Transforms/InstCombine/call.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/call.ll?rev=321706&r1=321705&r2=321706&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/call.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/call.ll Wed Jan  3 05:35:43 2018
@@ -287,3 +287,14 @@ entry:
 ; CHECK-LABEL: @test17(
 ; CHECK: call i32 @pr28655(i32 0)
 ; CHECK: ret i32 0
+
+define void @non_vararg(i8*, i32) {
+  ret void
+}
+
+define void @test_cast_to_vararg(i8* %this) {
+; CHECK-LABEL: test_cast_to_vararg
+; CHECK:  call void @non_vararg(i8* %this, i32 42)
+  call void (i8*, ...) bitcast (void (i8*, i32)* @non_vararg to void (i8*, ...)*)(i8* %this, i32 42)
+  ret void
+}




More information about the llvm-commits mailing list