[TTI] getTypeBasedIntrinsicInstrCost - add basic handling for strided load/store...
[llvm-project.git] / llvm / test / CodeGen / BPF / bpf-fastcall-4.ll
blobe67350690a48902acdfde352e4283ab118c7f92b
1 ; RUN: llc -O2 --mtriple=bpfel %s -o - | FileCheck %s
3 ; Generated from the following C code:
5 ;   extern int foo(void) __attribute__((bpf_fastcall));
7 ;   int bar(int a) {
8 ;     foo();
9 ;     return a;
10 ;   }
12 ; Using the following command:
14 ;   clang --target=bpf -emit-llvm -O2 -S -o - t.c
16 ; (unnecessary attrs removed maually)
18 ; Check that function marked with bpf_fastcall does not clobber W1-W5.
20 define dso_local i32 @bar(i32 %a) {
21 entry:
22   %call = tail call i32 @foo() #0
23   ret i32 %a
26 ; CHECK:      # %bb.0:
27 ; CHECK-NEXT:   *(u64 *)(r10 - 8) = r1
28 ; CHECK-NEXT:   call foo
29 ; CHECK-NEXT:   r1 = *(u64 *)(r10 - 8)
30 ; CHECK-NEXT:   w0 = w1
31 ; CHECK-NEXT:   exit
33 declare dso_local i32 @foo() #0
35 attributes #0 = { "bpf_fastcall" }