1 // RUN: mlir-tblgen -I %S/../../include %s 2>&1 | FileCheck %s --implicit-check-not warning:
3 include "mlir/IR/OpBase.td"
5 def Test_Dialect : Dialect {
6 let name = "test_dialect";
9 def OpTraitA : NativeOpTrait<"OpTraitA">, Deprecated<"use `bar` instead">;
11 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
13 NativeOpTrait value = OpTraitA;
16 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
18 list<NativeOpTrait> value = [OpTraitA];
21 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
23 list<list<NativeOpTrait>> value = [[OpTraitA]];
28 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
29 def D_InDagAsOperator {
30 dag value = (OpTraitA $test);
33 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
34 def E_InDagAsArg : Base {
35 dag value = (ins OpTraitA:$test);
38 class ThingTakingList<list<NativeOpTrait> l> {
39 list<NativeOpTrait> i = l; // avoid unused variable warning.
42 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
43 def F_AsFieldWithinAnonymousDef {
44 ThingTakingList value = ThingTakingList<[OpTraitA]>;
47 // CHECK: :[[# @LINE + 1]]:{{[0-9]+}}: warning: Using deprecated def `OpTraitA`
48 def G_InDagAsAnonymousDefOperator {
49 dag value = (ThingTakingList<[OpTraitA]> $test);
52 def H_ButNotTransitivelyInNonAnonymousDef {
53 Base value = E_InDagAsArg;