2022-02-04 20:39:52 +08:00
|
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
2019-04-17 12:52:47 +08:00
|
|
|
|
|
|
|
define signext i32 @b(i32* inreg %x) {
|
|
|
|
ret i32 0
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @c(...) {
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare void @useit(i32)
|
|
|
|
|
|
|
|
define void @d(i32 %x, ...) {
|
|
|
|
call void @useit(i32 %x)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @g(i32* %y) {
|
|
|
|
call i32 bitcast (i32 (i32*)* @b to i32 (i32)*)(i32 zeroext 0)
|
|
|
|
call void bitcast (void (...)* @c to void (i32*)*)(i32* %y)
|
2020-11-21 03:07:11 +08:00
|
|
|
call void bitcast (void (...)* @c to void (i32*)*)(i32* sret(i32) %y)
|
|
|
|
call void bitcast (void (i32, ...)* @d to void (i32, i32*)*)(i32 0, i32* sret(i32) %y)
|
2019-04-17 12:52:47 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
; CHECK-LABEL: define void @g(i32* %y)
|
|
|
|
; CHECK: call i32 bitcast (i32 (i32*)* @b to i32 (i32)*)(i32 zeroext 0)
|
|
|
|
; CHECK: call void (...) @c(i32* %y)
|
2020-11-21 03:07:11 +08:00
|
|
|
; CHECK: call void bitcast (void (...)* @c to void (i32*)*)(i32* sret(i32) %y)
|
|
|
|
; CHECK: call void bitcast (void (i32, ...)* @d to void (i32, i32*)*)(i32 0, i32* sret(i32) %y)
|