mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
6203a57d08
This adds support for opaque pointers in intrinsic type checks of IIT kind Pointer and PtrToElt. This is less straight-forward than it might initially seem, because we should only accept opaque pointers here in --force-opaque-pointers mode. Otherwise, there would be more than one valid type signature for a given intrinsic name. Differential Revision: https://reviews.llvm.org/D105155
21 lines
874 B
LLVM
21 lines
874 B
LLVM
; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s --check-prefix=TYPED
|
|
; RUN: llvm-as --force-opaque-pointers < %s | llvm-dis --force-opaque-pointers | FileCheck %s --check-prefix=OPAQUE
|
|
|
|
; An opaque pointer type should not be accepted for an intrinsic that
|
|
; specifies a fixed pointer type, outside of --force-opaque-pointers mode.
|
|
|
|
define void @test() {
|
|
; TYPED: Intrinsic has incorrect return type!
|
|
; OPAQUE: call ptr @llvm.stacksave()
|
|
call ptr @llvm.stacksave()
|
|
|
|
; TYPED: Intrinsic has incorrect argument type!
|
|
; OPAQUE: call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
|
|
call <2 x i64> @llvm.masked.expandload.v2i64(ptr null, <2 x i1> zeroinitializer, <2 x i64> zeroinitializer)
|
|
|
|
ret void
|
|
}
|
|
|
|
declare ptr @llvm.stacksave()
|
|
declare <2 x i64> @llvm.masked.expandload.v2i64(ptr, <2 x i1>, <2 x i64>)
|