aboutsummaryrefslogtreecommitdiff
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/test/Transforms/InstCombine/byval.ll27
1 files changed, 22 insertions, 5 deletions
diff --git a/llvm/test/Transforms/InstCombine/byval.ll b/llvm/test/Transforms/InstCombine/byval.ll
index fa6b2bc..b7459ef1 100644
--- a/llvm/test/Transforms/InstCombine/byval.ll
+++ b/llvm/test/Transforms/InstCombine/byval.ll
@@ -1,21 +1,38 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=instcombine %s | FileCheck %s
declare void @add_byval_callee(double*)
-; CHECK-LABEL: define void @add_byval
-; CHECK: [[ARG:%.*]] = bitcast i64* %in to double*
-; CHECK: call void @add_byval_callee(double* byval(double) [[ARG]])
+declare void @add_byval_callee_2(double* byval(double))
+
define void @add_byval(i64* %in) {
+; CHECK-LABEL: @add_byval(
+; CHECK-NEXT: [[TMP1:%.*]] = bitcast i64* [[IN:%.*]] to double*
+; CHECK-NEXT: call void @add_byval_callee(double* byval(double) [[TMP1]])
+; CHECK-NEXT: ret void
+;
%tmp = bitcast void (double*)* @add_byval_callee to void (i64*)*
call void %tmp(i64* byval(i64) %in)
ret void
}
+define void @add_byval_2(i64* %in) {
+; CHECK-LABEL: @add_byval_2(
+; CHECK-NEXT: call void bitcast (void (double*)* @add_byval_callee_2 to void (i64*)*)(i64* byval(i64) [[IN:%.*]])
+; CHECK-NEXT: ret void
+;
+ %tmp = bitcast void (double*)* @add_byval_callee_2 to void (i64*)*
+ call void %tmp(i64* byval(i64) %in)
+ ret void
+}
+
%t2 = type { i8 }
-; CHECK-LABEL: define void @vararg_byval
-; CHECK: call void (i8, ...) @vararg_callee(i8 undef, i8* byval(i8) %p)
define void @vararg_byval(i8* %p) {
+; CHECK-LABEL: @vararg_byval(
+; CHECK-NEXT: call void (i8, ...) @vararg_callee(i8 undef, i8* byval(i8) [[P:%.*]])
+; CHECK-NEXT: ret void
+;
%tmp = bitcast i8* %p to %t2*
call void (i8, ...) @vararg_callee(i8 undef, %t2* byval(%t2) %tmp)
ret void