3
3
; RUN: | FileCheck -check-prefix=RV32I %s
4
4
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
5
5
; RUN: | FileCheck -check-prefix=RV64I %s
6
+ ; RUN: llc -mtriple=riscv64 -mattr=+experimental-zicfilp -verify-machineinstrs < %s \
7
+ ; RUN: | FileCheck -check-prefix=RV64I-ZICFILP %s
6
8
7
9
; Tests that the 'nest' parameter attribute causes the relevant parameter to be
8
10
; passed in the right register.
@@ -17,6 +19,12 @@ define ptr @nest_receiver(ptr nest %arg) nounwind {
17
19
; RV64I: # %bb.0:
18
20
; RV64I-NEXT: mv a0, t2
19
21
; RV64I-NEXT: ret
22
+ ;
23
+ ; RV64I-ZICFILP-LABEL: nest_receiver:
24
+ ; RV64I-ZICFILP: # %bb.0:
25
+ ; RV64I-ZICFILP-NEXT: lpad 0
26
+ ; RV64I-ZICFILP-NEXT: mv a0, t3
27
+ ; RV64I-ZICFILP-NEXT: ret
20
28
ret ptr %arg
21
29
}
22
30
@@ -40,6 +48,21 @@ define ptr @nest_caller(ptr %arg) nounwind {
40
48
; RV64I-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
41
49
; RV64I-NEXT: addi sp, sp, 16
42
50
; RV64I-NEXT: ret
51
+ ;
52
+ ; RV64I-ZICFILP-LABEL: nest_caller:
53
+ ; RV64I-ZICFILP: # %bb.0:
54
+ ; RV64I-ZICFILP-NEXT: lpad 0
55
+ ; RV64I-ZICFILP-NEXT: addi sp, sp, -16
56
+ ; RV64I-ZICFILP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
57
+ ; RV64I-ZICFILP-NEXT: mv t3, a0
58
+ ; RV64I-ZICFILP-NEXT: call nest_receiver
59
+ ; RV64I-ZICFILP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
60
+ ; RV64I-ZICFILP-NEXT: addi sp, sp, 16
61
+ ; RV64I-ZICFILP-NEXT: ret
43
62
%result = call ptr @nest_receiver (ptr nest %arg )
44
63
ret ptr %result
45
64
}
65
+
66
+ !llvm.module.flags = !{!0 }
67
+
68
+ !0 = !{i32 8 , !"cf-protection-branch" , i32 1 }
0 commit comments