llvm-project/llvm/test/TableGen/intrinsic-duplicate-name.td
Rahul Joshi e0458a24a1
[LLVM][TableGen] Add error check for duplicate intrinsic names (#109226)
Check for duplicate intrinsic names in the intrinsic emitter backend and
issue a fatal error if we find one.
2024-09-19 05:21:00 -07:00

10 lines
438 B
TableGen

// RUN: not llvm-tblgen -gen-intrinsic-impl -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS 2>&1 | FileCheck %s -DFILE=%s
include "llvm/IR/Intrinsics.td"
def int_foo0 : Intrinsic<[llvm_anyint_ty], [], [], "llvm.foo">;
// CHECK: [[FILE]]:[[@LINE+2]]:5: error: Intrinsic `llvm.foo` is already defined
// CHECK: [[FILE]]:[[@LINE-3]]:5: note: Previous definition here
def int_foo1 : Intrinsic<[llvm_anyint_ty], [], [], "llvm.foo">;