
This was trying to auto-upgrade a read_register call with missing type mangling. This first would break since getCalledFunction checks the callee type is consistent, so this would assert there. After that, the replacement code would die on the type mismatch. Be more defensive and let the verifier code produce an error that the IR is broken.
15 lines
431 B
LLVM
15 lines
431 B
LLVM
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
|
|
|
|
; CHECK: Intrinsic called with incompatible signature
|
|
; CHECK-NEXT: %reg = call i32 @llvm.read_register.i64(
|
|
; CHECK: Invalid user of intrinsic instruction!
|
|
; CHECK-NEXT: %reg = call i32 @llvm.read_register.i64(
|
|
define i32 @read_register_missing_mangling() {
|
|
%reg = call i32 @llvm.read_register(metadata !0)
|
|
ret i32 %reg
|
|
}
|
|
|
|
declare i64 @llvm.read_register(metadata)
|
|
|
|
!0 = !{!"foo"}
|