1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/Verifier/intrinsic-addr-taken.ll
Nikita Popov 2bbc0bd7c0 [Verifier] Extend address taken check for unknown intrinsics
Intrinsics can only be called directly, taking their address is not
legal. This is currently only enforced for intrinsics that have an
ID, rather than all intrinsics. Adjust the check to cover all
intrinsics.

This came up in D106013.

Differential Revision: https://reviews.llvm.org/D106095
2021-07-15 23:16:14 +02:00

10 lines
308 B
LLVM

; RUN: not llvm-as < %s 2>&1 | FileCheck %s
declare i32 @llvm.umax.i32(i32, i32)
declare i32 @llvm.my.custom.intrinsic()
; CHECK: Invalid user of intrinsic instruction!
@g1 = global i32(i32, i32)* @llvm.umax.i32
; CHECK: Invalid user of intrinsic instruction!
@g2 = global i32()* @llvm.my.custom.intrinsic