llvm-project/llvm/test/TableGen/intrinsic-target-prefix-for-target-independent.td
Rahul Joshi 2f43e65955
[LLVM][TableGen] Check name conflicts between target dep and independent intrinsics (#109826)
Validate that for target independent intrinsics the second dotted
component of their name (after the `llvm.`) does not match any existing
target names (for which atleast one intrinsic has been defined). Doing
so is invalid as LLVM will search for that intrinsic in that target's
intrinsic table and not find it, and conclude that its an unknown
intrinsic.
2024-09-25 12:01:17 -07:00

10 lines
441 B
TableGen

// RUN: not llvm-tblgen -gen-intrinsic-enums -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s
include "llvm/IR/Intrinsics.td"
// Check that target independent intrinsics with a prefix that matches a target
// name are flagged.
// CHECK: [[FILE]]:[[@LINE+1]]:5: error: target independent intrinsic `llvm.aarch64.foo' has prefix `llvm.aarch64` that conflicts with intrinsics for target `aarch64`
def int_aarch64_foo : Intrinsic<[],[]>;