64 lines · plain
1;; Test the function attribute "patchable-function-entry".2;; Adapted from the RISCV test case.3; RUN: llc --mtriple=loongarch32 -mattr=+d < %s | FileCheck %s --check-prefixes=CHECK,LA324; RUN: llc --mtriple=loongarch64 -mattr=+d < %s | FileCheck %s --check-prefixes=CHECK,LA645 6define void @f0() "patchable-function-entry"="0" {7; CHECK-LABEL: f0:8; CHECK-NEXT: .Lfunc_begin0:9; CHECK-NOT: nop10; CHECK: ret11; CHECK-NOT: .section __patchable_function_entries12 ret void13}14 15define void @f1() "patchable-function-entry"="1" {16; CHECK-LABEL: f1:17; CHECK-NEXT: .Lfunc_begin1:18; CHECK: nop19; CHECK-NEXT: ret20; CHECK: .section __patchable_function_entries,"awo",@progbits,f1{{$}}21; LA32: .p2align 222; LA32-NEXT: .word .Lfunc_begin123; LA64: .p2align 324; LA64-NEXT: .dword .Lfunc_begin125 ret void26}27 28$f5 = comdat any29define void @f5() "patchable-function-entry"="5" comdat {30; CHECK-LABEL: f5:31; CHECK-NEXT: .Lfunc_begin2:32; CHECK-COUNT-5: nop33; CHECK-NEXT: ret34; CHECK: .section __patchable_function_entries,"awoG",@progbits,f5,f5,comdat{{$}}35; LA32: .p2align 236; LA32-NEXT: .word .Lfunc_begin237; LA64: .p2align 338; LA64-NEXT: .dword .Lfunc_begin239 ret void40}41 42;; -fpatchable-function-entry=3,243;; "patchable-function-prefix" emits data before the function entry label.44define void @f3_2() "patchable-function-entry"="1" "patchable-function-prefix"="2" {45; CHECK-LABEL: .type f3_2,@function46; CHECK-NEXT: .Ltmp0:47; CHECK-COUNT-2: nop48; CHECK-NEXT: f3_2: # @f3_249; CHECK: # %bb.0:50; CHECK-NEXT: nop51; LA32-NEXT: addi.w $sp, $sp, -1652; LA64-NEXT: addi.d $sp, $sp, -1653;; .size does not include the prefix.54; CHECK: .Lfunc_end3:55; CHECK-NEXT: .size f3_2, .Lfunc_end3-f3_256; CHECK: .section __patchable_function_entries,"awo",@progbits,f3_2{{$}}57; LA32: .p2align 258; LA32-NEXT: .word .Ltmp059; LA64: .p2align 360; LA64-NEXT: .dword .Ltmp061 %frame = alloca i8, i32 1662 ret void63}64