brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · 49d8a73 Raw
40 lines · plain
1// RUN: not llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common -DERROR1 %s 2>&1 | FileCheck --check-prefix=ERROR1 %s2// RUN: not llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common -DERROR2 %s 2>&1 | FileCheck --check-prefix=ERROR2 %s3// RUN: not llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common -DERROR3 %s 2>&1 | FileCheck --check-prefix=ERROR3 %s4// RUN: not llvm-tblgen -gen-dag-isel -I %p/../../include -I %p/Common -DERROR4 %s 2>&1 | FileCheck --check-prefix=ERROR4 %s5 6include "llvm/Target/Target.td"7include "GlobalISelEmitterCommon.td"8 9def int_foo : Intrinsic<[llvm_anyint_ty, llvm_anyint_ty], [llvm_i32_ty]>;10def int_bar : Intrinsic<[], []>;11 12def INSTR_FOO : Instruction {13  let OutOperandList = (outs GPR32:$a, GPR32:$b);14  let InOperandList = (ins GPR32:$c);15}16def INSTR_BAR : Instruction {17  let OutOperandList = (outs);18  let InOperandList = (ins);19}20 21#ifdef ERROR122// ERROR1: [[@LINE+1]]:1: error: {{.*}} Invalid number of type casts!23def : Pat<([i32, i32, i32] (int_foo (i32 GPR32:$a))), ([i32, i32, i32] (INSTR_FOO $a))>;24#endif25 26#ifdef ERROR227// ERROR2: [[@LINE+1]]:1: error: {{.*}} Invalid number of type casts!28def : Pat<([]<ValueType> (int_bar)), ([]<ValueType> (INSTR_BAR))>;29#endif30 31#ifdef ERROR332// ERROR3: [[@LINE+1]]:1: error: {{.*}} Type cast only takes one operand!33def : Pat<([i32, i32] (int_foo), (int_foo)), ([i32, i32] (INSTR_FOO))>;34#endif35 36#ifdef ERROR437// ERROR4: [[@LINE+1]]:1: error: {{.*}} Type cast should not have a name!38def : Pat<([i32, i32] ([i32, i32] (int_foo)):$name), ([i32, i32] (INSTR_FOO))>;39#endif40