1 ; RUN: llc -mtriple arm-unknown -mattr=-v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,NOV4T 2 ; RUN: llc -mtriple arm-unknown -mattr=+v4t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V4T 3 ; RUN: llc -mtriple arm-unknown -mattr=+v5t -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=CHECK,V5T 4 5 define arm_aapcscc void @test_indirect_call(void() *%fptr) { 6 ; CHECK-LABEL: name: test_indirect_call 7 ; V5T: %[[FPTR:[0-9]+]]:gpr(p0) = COPY $r0 8 ; V4T: %[[FPTR:[0-9]+]]:tgpr(p0) = COPY $r0 9 ; NOV4T: %[[FPTR:[0-9]+]]:tgpr(p0) = COPY $r0 10 ; CHECK: ADJCALLSTACKDOWN 0, 0, 14, $noreg, implicit-def $sp, implicit $sp 11 ; V5T: BLX %[[FPTR]](p0), csr_aapcs, implicit-def $lr, implicit $sp 12 ; V4T: BX_CALL %[[FPTR]](p0), csr_aapcs, implicit-def $lr, implicit $sp 13 ; NOV4T: BMOVPCRX_CALL %[[FPTR]](p0), csr_aapcs, implicit-def $lr, implicit $sp 14 ; CHECK: ADJCALLSTACKUP 0, 0, 14, $noreg, implicit-def $sp, implicit $sp 15 entry: 16 notail call arm_aapcscc void %fptr() 17 ret void 18 } 19 20 declare arm_aapcscc void @call_target() 21 22 define arm_aapcscc void @test_direct_call() { 23 ; CHECK-LABEL: name: test_direct_call 24 ; CHECK: ADJCALLSTACKDOWN 0, 0, 14, $noreg, implicit-def $sp, implicit $sp 25 ; CHECK: BL @call_target, csr_aapcs, implicit-def $lr, implicit $sp 26 ; CHECK: ADJCALLSTACKUP 0, 0, 14, $noreg, implicit-def $sp, implicit $sp 27 entry: 28 notail call arm_aapcscc void @call_target() 29 ret void 30 } 31