1 // RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/Common -I %p/../../include %s -o - < %s | FileCheck -check-prefix=GISEL %s
3 include "llvm/Target/Target.td"
4 include "GlobalISelEmitterCommon.td"
6 let TargetPrefix = "mytarget" in {
7 def int_mytarget_sleep0 : Intrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
8 def int_mytarget_sleep1 : Intrinsic<[], [llvm_i32_ty], [ImmArg<ArgIndex<0>>]>;
11 // GISEL: GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_INTRINSIC_W_SIDE_EFFECTS),
12 // GISEL-NEXT: // MIs[0] Operand 0
13 // GISEL-NEXT: GIM_CheckIntrinsicID, /*MI*/0, /*Op*/0, GIMT_Encode2(Intrinsic::mytarget_sleep0),
14 // GISEL-NEXT: // MIs[0] src
15 // GISEL-NEXT: GIM_CheckIsImm, /*MI*/0, /*Op*/1,
16 // GISEL-NEXT: // (intrinsic_void {{[0-9]+}}:{ *:[iPTR] }, (timm:{ *:[i32] }):$src) => (SLEEP0 (timm:{ *:[i32] }):$src)
17 // GISEL-NEXT: GIR_BuildMI, /*InsnID*/0, /*Opcode*/GIMT_Encode2(MyTarget::SLEEP0),
18 // GISEL-NEXT: GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/1, // src
19 def SLEEP0 : I<(outs), (ins i32imm:$src),
20 [(int_mytarget_sleep0 timm:$src)]
23 // Test for situation which was crashing in ARM patterns.
24 def p_imm : Operand<i32>;
25 def SLEEP1 : I<(outs), (ins p_imm:$src), []>;
27 // FIXME: This should not crash, but should it work or be an error?
29 // (int_mytarget_sleep1 timm:$src),