1 ; RUN: llc --mtriple=xtensa < %s | FileCheck %s
3 declare i32 @external_function(i32)
5 define i32 @test_call_external(i32 %a) nounwind {
6 ; CHECK-LABEL: test_call_external:
8 ; CHECK: s32i a0, a1, 0
9 ; CHECK-NEXT: l32r a8, .LCPI0_0
10 ; CHECK-NEXT: callx0 a8
11 ; CHECK-NEXT: l32i a0, a1, 0
13 %1 = call i32 @external_function(i32 %a)
17 define i32 @defined_function(i32 %a) nounwind {
18 ; CHECK-LABEL: defined_function:
20 ; CHECK-NEXT: addi a2, a2, 1
26 define i32 @test_call_defined(i32 %a) nounwind {
27 ; CHECK-LABEL: test_call_defined:
29 ; CHECK: s32i a0, a1, 0
30 ; CHECK-NEXT: l32r a8, .LCPI2_0
31 ; CHECK-NEXT: callx0 a8
32 ; CHECK-NEXT: l32i a0, a1, 0
34 %1 = call i32 @defined_function(i32 %a) nounwind
38 define i32 @test_call_indirect(ptr %a, i32 %b) nounwind {
39 ; CHECK-LABEL: test_call_indirect:
41 ; CHECK: s32i a0, a1, 0
42 ; CHECK-NEXT: or a8, a2, a2
43 ; CHECK-NEXT: or a2, a3, a3
44 ; CHECK-NEXT: callx0 a8
45 ; CHECK-NEXT: l32i a0, a1, 0
47 %1 = call i32 %a(i32 %b)