48 lines · plain
1// RUN: llvm-tblgen -gen-intrinsic-enums -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS | FileCheck %s2// RUN: not llvm-tblgen -gen-intrinsic-enums -I %p/../../include %s -DTEST_INTRINSICS_SUPPRESS_DEFS -DCONFLICT 2>&1 | FileCheck %s -DFILE=%s --check-prefix=CHECK-CONFLICT3 4 5include "llvm/IR/Intrinsics.td"6// CHECK: foo = 1,7def int_foo : Intrinsic<[llvm_any_ty]>;8 9// No conflicts, since .bar is not a valid mangled type.10// CHECK: foo_bar,11def int_foo_bar : Intrinsic<[llvm_i32_ty]>;12 13// CHECK: foo_bar_f32,14def int_foo_bar_f32 : Intrinsic<[llvm_i32_ty]>;15 16// No conflicts, since i is not a valid mangled type without a bitwidth.17// CHECK: foo_i18def int_foo_i : Intrinsic<[llvm_i32_ty]>;19 20#ifdef CONFLICT21// CHECK-CONFLICT: error: intrinsic `llvm.foo.a3` cannot share prefix `llvm.foo.a3` with another overloaded intrinsic `llvm.foo`22// CHECK-CONFLICT: error: intrinsic `llvm.foo.bf16` cannot share prefix `llvm.foo.bf16` with another overloaded intrinsic `llvm.foo`23// CHECK-CONFLICT: error: intrinsic `llvm.foo.f32` cannot share prefix `llvm.foo.f32` with another overloaded intrinsic `llvm.foo`24// CHECK-CONFLICT: error: intrinsic `llvm.foo.f64` cannot share prefix `llvm.foo.f64` with another overloaded intrinsic `llvm.foo`25// CHECK-CONFLICT: error: intrinsic `llvm.foo.f_3` cannot share prefix `llvm.foo.f_3` with another overloaded intrinsic `llvm.foo`26// CHECK-CONFLICT: error: intrinsic `llvm.foo.i65` cannot share prefix `llvm.foo.i65` with another overloaded intrinsic `llvm.foo`27// CHECK-CONFLICT: error: intrinsic `llvm.foo.i65.bar` cannot share prefix `llvm.foo.i65` with another overloaded intrinsic `llvm.foo`28// CHECK-CONFLICT: error: intrinsic `llvm.foo.p3` cannot share prefix `llvm.foo.p3` with another overloaded intrinsic `llvm.foo`29// CHECK-CONFLICT: error: intrinsic `llvm.foo.s_3` cannot share prefix `llvm.foo.s_3` with another overloaded intrinsic `llvm.foo`30// CHECK-CONFLICT: error: intrinsic `llvm.foo.v4` cannot share prefix `llvm.foo.v4` with another overloaded intrinsic `llvm.foo`31// CHECK-CONFLICT: 10 errors32// CHECK-CONFLICT-NOT: error33 34// Conflicts due to suffix being a possible mangled type.35def int_foo_f32 : Intrinsic<[llvm_i32_ty]>;36def int_foo_f64 : Intrinsic<[llvm_i32_ty]>;37def int_foo_bf16: Intrinsic<[llvm_i32_ty]>;38def int_foo_p3 : Intrinsic<[llvm_i32_ty]>;39def int_foo_a3 : Intrinsic<[llvm_i32_ty]>;40def int_foo_v4 : Intrinsic<[llvm_i32_ty]>;41def int_foo_func : Intrinsic<[llvm_i32_ty], [], [], "llvm.foo.f_3">;42def int_foo_struct : Intrinsic<[llvm_i32_ty], [], [], "llvm.foo.s_3">;43def int_foo_t3 : Intrinsic<[llvm_i32_ty]>;44def int_foo_i65 : Intrinsic<[llvm_i32_ty]>;45def int_foo_i65_bar : Intrinsic<[llvm_i32_ty]>;46 47#endif48