59 lines · plain
1; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,NOC2; RUN: llc -mtriple=riscv64 -mattr=+c -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,C3 4;; The alignment is at least 4 to avoid unaligned type hash loads when this5;; instrumented function is indirectly called.6; CHECK-LABEL: .globl f17; CHECK: .p2align 28; CHECK-NOT: nop9; CHECK: .word 1234567810; CHECK-LABEL: f1:11define void @f1(ptr noundef %x) !kcfi_type !1 {12; CHECK: lw t1, -4(a0)13 call void %x() [ "kcfi"(i32 12345678) ]14 ret void15}16 17; CHECK-LABEL: .globl f218; NOC: .p2align 219; C: .p2align 120; CHECK-NOT: .word21; CHECK-NOT: nop22; CHECK-LABEL: f2:23define void @f2(ptr noundef %x) {24; CHECK: lw t1, -4(a0)25 call void %x() [ "kcfi"(i32 12345678) ]26 ret void27}28 29; CHECK-LABEL: .globl f330; CHECK: .p2align 231; CHECK: .word 1234567832; CHECK-COUNT-11: nop33; CHECK-LABEL: f3:34define void @f3(ptr noundef %x) #0 !kcfi_type !1 {35; NOC: lw t1, -48(a0)36; C: lw t1, -26(a0)37 call void %x() [ "kcfi"(i32 12345678) ]38 ret void39}40 41; CHECK-LABEL: .globl f442; NOC: .p2align 243; C: .p2align 144; CHECK-NOT: .word45; CHECK-COUNT-11: nop46; CHECK-LABEL: f4:47define void @f4(ptr noundef %x) #0 {48; NOC: lw t1, -48(a0)49; C: lw t1, -26(a0)50 call void %x() [ "kcfi"(i32 12345678) ]51 ret void52}53 54attributes #0 = { "patchable-function-prefix"="11" }55 56!llvm.module.flags = !{!0}57!0 = !{i32 4, !"kcfi", i32 1}58!1 = !{i32 12345678}59