150
|
1 // RUN: llvm-tblgen -gen-intrinsic-impl %s | FileCheck %s
|
|
2
|
|
3 // This test is validating that it an Intrinsic with an LLVMPointerType to
|
|
4 // llvm_any_ty still properly work after r363233. That patch rewrote the
|
|
5 // substitution handling code in the Intrinsic Emitter, and didn't consider this
|
|
6 // case, so TableGen would hit an assertion in EncodeFixedType that was checking
|
|
7 // to ensure that the substitution being processed was correctly replaced.
|
|
8
|
207
|
9 class IntrinsicProperty<bit is_default = 0> {
|
|
10 bit IsDefault = is_default;
|
|
11 }
|
|
12
|
150
|
13 class SDNodeProperty;
|
|
14
|
|
15 class ValueType<int size, int value> {
|
|
16 string Namespace = "MVT";
|
|
17 int Size = size;
|
|
18 int Value = value;
|
|
19 }
|
|
20
|
|
21 def iPTR : ValueType<0 , 254>;
|
|
22 def Any : ValueType<0 , 255>;
|
|
23
|
|
24 class LLVMType<ValueType vt> {
|
|
25 ValueType VT = vt;
|
|
26 int isAny = 0;
|
|
27 }
|
|
28
|
|
29
|
|
30 class Intrinsic<list<LLVMType> ret_types> {
|
|
31 string LLVMName = "";
|
|
32 string TargetPrefix = ""; // Set to a prefix for target-specific intrinsics.
|
|
33 list<LLVMType> RetTypes = ret_types;
|
|
34 list<LLVMType> ParamTypes = [];
|
|
35 list<IntrinsicProperty> IntrProperties = [];
|
|
36 list<SDNodeProperty> Properties = [];
|
|
37 bit isTarget = 0;
|
207
|
38 bit DisableDefaultAttributes = 1;
|
150
|
39 }
|
|
40
|
|
41 class LLVMQualPointerType<LLVMType elty>
|
|
42 : LLVMType<iPTR>{
|
|
43 LLVMType ElTy = elty;
|
|
44 int AddrSpace = 0;
|
|
45 }
|
|
46
|
|
47 class LLVMPointerType<LLVMType elty>
|
|
48 : LLVMQualPointerType<elty>;
|
|
49
|
|
50 let isAny = 1 in {
|
|
51 def llvm_any_ty : LLVMType<Any>;
|
|
52 }
|
|
53 def i8 : ValueType<8, 3>;
|
|
54 def llvm_i8_ty : LLVMType<i8>;
|
|
55
|
|
56 def int_has_ptr_to_any : Intrinsic<[LLVMPointerType<llvm_any_ty>, llvm_i8_ty]>;
|
|
57 // CHECK: /* 0 */ 21, 14, 15, 0, 2, 0
|