~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/TableGen/intrinsic-order.td

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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> Properties = [];
 
23
}
 
24
 
 
25
def iAny : ValueType<0, 254>;
 
26
def llvm_anyint_ty : LLVMType<iAny>;
 
27
 
 
28
 
 
29
// Make sure an intrinsic name that is a prefix of another is checked after the
 
30
// other.
 
31
 
 
32
// CHECK: if (NameR.startswith("oo.bar.")) return Intrinsic::foo_bar;
 
33
// CHECK: if (NameR.startswith("oo.")) return Intrinsic::foo;
 
34
 
 
35
def int_foo : Intrinsic<"llvm.foo", [llvm_anyint_ty]>;
 
36
def int_foo_bar : Intrinsic<"llvm.foo.bar", [llvm_anyint_ty]>;