Home | History | Annotate | Download | only in TableGen
      1 // RUN: llvm-tblgen -gen-intrinsic %s | FileCheck %s
      2 // XFAIL: vg_leak
      3 
      4 class IntrinsicProperty;
      5 
      6 class ValueType<int size, int value> {
      7   string Namespace = "MVT";
      8   int Size = size;
      9   int Value = value;
     10 }
     11 
     12 class LLVMType<ValueType vt> {
     13   ValueType VT = vt;
     14 }
     15 
     16 class Intrinsic<string name, list<LLVMType> param_types = []> {
     17   string LLVMName = name;
     18   bit isTarget = 0;
     19   string TargetPrefix = "";
     20   list<LLVMType> RetTypes = [];
     21   list<LLVMType> ParamTypes = param_types;
     22   list<IntrinsicProperty> IntrProperties = [];
     23 }
     24 
     25 def iAny : ValueType<0, 125>;
     26 def llvm_anyint_ty : LLVMType<iAny>;
     27 
     28 // Make sure we generate the long name without crashing
     29 // CHECK: this_is_a_really_long_intrinsic_name_but_we_should_still_not_crash   // llvm.this.is.a.really.long.intrinsic.name.but.we.should.still.not.crash
     30 def int_foo : Intrinsic<"llvm.foo", [llvm_anyint_ty]>;
     31 def int_this_is_a_really_long_intrinsic_name_but_we_should_still_not_crash : Intrinsic<"llvm.this.is.a.really.long.intrinsic.name.but.we.should.still.not.crash", [llvm_anyint_ty]>;
     32 
     33