brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.9 KiB · f6c2d17 Raw
93 lines · plain
1// RUN: llvm-tblgen -gen-sd-node-info -I %p/../../../include %s 2> %t.warn | FileCheck %s2// RUN: FileCheck --check-prefix=WARN --implicit-check-not=warning %s < %t.warn3 4// RUN: llvm-tblgen -gen-sd-node-info -warn-on-skipped-nodes=false \5// RUN:   -I %p/../../../include %s 2> %t.nowarn | FileCheck %s6// RUN: not test -s %t.nowarn7 8include "llvm/Target/Target.td"9 10def MyTarget : Target;11 12// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name13def bad_name_1 : SDNode<"", SDTypeProfile<0, 0, []>>;14 15// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name16def bad_name_2 : SDNode<"NODE", SDTypeProfile<0, 0, []>>;17 18// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name19def bad_name_3 : SDNode<"MyTargetISD::", SDTypeProfile<0, 0, []>>;20 21// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name22def bad_name_4 : SDNode<"MyISD::", SDTypeProfile<0, 0, []>>;23 24// WARN: [[#@LINE+1]]:5: warning: skipped node: invalid enum name25def bad_name_5 : SDNode<"::NODE", SDTypeProfile<0, 0, []>>;26 27 28// Standard namespace.29def silent_1 : SDNode<"ISD::SILENT", SDTypeProfile<0, 0, []>>;30 31// Different namespace.32def silent_2 : SDNode<"MyISD::SILENT", SDTypeProfile<0, 0, []>>;33 34 35// Different number of results.36// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description37// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description38def node_1a : SDNode<"MyTargetISD::NODE_1", SDTypeProfile<0, 0, []>>;39def node_1b : SDNode<"MyTargetISD::NODE_1", SDTypeProfile<1, 0, []>>;40 41// Different number of operands.42// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description43// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description44def node_2a : SDNode<"MyTargetISD::NODE_2", SDTypeProfile<0, 0, []>>;45def node_2b : SDNode<"MyTargetISD::NODE_2", SDTypeProfile<0, 1, []>>;46 47// Different value of IsStrictFP.48// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description49// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description50let IsStrictFP = true in51def node_3a : SDNode<"MyTargetISD::NODE_3", SDTypeProfile<0, 0, []>>;52def node_3b : SDNode<"MyTargetISD::NODE_3", SDTypeProfile<0, 0, []>>;53 54// Different value of TSFlags.55// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description56// WARN: [[#@LINE+3]]:5: warning: skipped node: incompatible description57let TSFlags = 1 in58def node_4a : SDNode<"MyTargetISD::NODE_4", SDTypeProfile<0, 0, []>>;59def node_4b : SDNode<"MyTargetISD::NODE_4", SDTypeProfile<0, 0, []>>;60 61// Different properties.62// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description63// WARN: [[#@LINE+2]]:5: warning: skipped node: incompatible description64def node_5a : SDNode<"MyTargetISD::NODE_5", SDTypeProfile<0, 0, []>>;65def node_5b : SDNode<"MyTargetISD::NODE_5", SDTypeProfile<0, 0, []>, [SDNPHasChain]>;66 67 68// CHECK:       enum GenNodeType : unsigned {69// CHECK-NEXT:    COMPAT = ISD::BUILTIN_OP_END,70// CHECK-NEXT:  };71 72// CHECK:       static constexpr char MyTargetSDNodeNamesStorage[] =73// CHECK-NEXT:    "\0"74// CHECK-NEXT:    "MyTargetISD::COMPAT\0"75// CHECK-NEXT:    ;76 77// CHECK:       static const SDTypeConstraint MyTargetSDTypeConstraints[] = {78// CHECK-NEXT:    /* dummy */ {SDTCisVT, 0, 0, 0, MVT::INVALID_SIMPLE_VALUE_TYPE}79// CHECK-NEXT:  };80// CHECK-EMPTY:81// CHECK-NEXT:  static const SDNodeDesc MyTargetSDNodeDescs[] = {82// CHECK-NEXT:      {1, -1, 0, 0, 0, 1, 0, 0}, // COMPAT83// CHECK-NEXT:  };84// CHECK-EMPTY:85// CHECK-NEXT:  static const SDNodeInfo MyTargetGenSDNodeInfo(86// CHECK-NEXT:      /*NumOpcodes=*/1, MyTargetSDNodeDescs, MyTargetSDNodeNames,87// CHECK-NEXT:      MyTargetVTByHwModeTable, MyTargetSDTypeConstraints);88 89def compat_a : SDNode<"MyTargetISD::COMPAT", SDTypeProfile<1, -1, []>>;90def compat_b : SDNode<"MyTargetISD::COMPAT", SDTypeProfile<1, -1, [SDTCisVT<0, untyped>]>>;91def compat_c : SDNode<"MyTargetISD::COMPAT", SDTypeProfile<1, -1, [SDTCisVT<0, untyped>]>,92    [SDNPCommutative, SDNPAssociative, SDNPMayStore, SDNPMayLoad, SDNPSideEffect]>;93