OSDN Git Service

[InstCombine] Add test to remove VarArg casts (NFC)
authorFlorian Hahn <florian.hahn@arm.com>
Wed, 3 Jan 2018 13:35:43 +0000 (13:35 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Wed, 3 Jan 2018 13:35:43 +0000 (13:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321706 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/call.ll

index 5307dcb..c494bfb 100644 (file)
@@ -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
+}