1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2
- ; RUN: llc --filetype=asm --code-model=tiny --mcpu=cheriot --mtriple=riscv32-unknown-unknown -target-abi cheriot %s -mattr=+xcheri,+cap-mode -o - | FileCheck %s -check-prefixes BOTH
3
- ; RUN: llc --filetype=asm --code-model=small --mcpu=cheriot --mtriple=riscv32-unknown-unknown -target-abi cheriot %s -mattr=+xcheri,+cap-mode -o - | FileCheck %s -check-prefixes BOTH
2
+ ; RUN: llc --filetype=asm --code-model=small --mcpu=cheriot --mtriple=riscv32-unknown-unknown -target-abi cheriot %s -mattr=+xcheri,+cap-mode -o - | FileCheck %s
4
3
; ModuleID = 'ccall.c'
5
4
source_filename = "ccall.c"
6
5
target datalayout = "e-m:e-pf200:64:64:64:32-p:32:32-i64:64-n32-S128-A200-P200-G200"
@@ -12,10 +11,10 @@ target triple = "riscv32-unknown-unknown"
12
11
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize readnone willreturn
13
12
define dso_local chericcallcce i32 @test2 (i32 %a0 , i32 %a1 ) local_unnamed_addr addrspace (200 ) #0 {
14
13
; Check that we have the first two arguments in the right registers.
15
- ; BOTH -LABEL: test2:
16
- ; BOTH : # %bb.0: # %entry
17
- ; BOTH : add a0, a0, a1
18
- ; BOTH : cret
14
+ ; CHECK -LABEL: test2:
15
+ ; CHECK : # %bb.0: # %entry
16
+ ; CHECK : add a0, a0, a1
17
+ ; CHECK : cret
19
18
entry:
20
19
%add = add nsw i32 %a1 , %a0
21
20
ret i32 %add
24
23
; Function Attrs: minsize mustprogress nofree norecurse nosync nounwind optsize readonly willreturn
25
24
define dso_local chericcallcce i32 @test6 (i32 addrspace (200 )* nocapture readonly %a0 , i32 addrspace (200 )* nocapture readonly %a1 , i32 addrspace (200 )* nocapture readonly %a2 , i32 addrspace (200 )* nocapture readonly %a3 , i32 addrspace (200 )* nocapture readonly %a4 , i32 addrspace (200 )* nocapture readonly %a5 ) local_unnamed_addr addrspace (200 ) #1 {
26
25
; Check that we are loading the last register argument
27
- ; BOTH -LABEL: test6:
28
- ; BOTH : clw a5, 0(ca5)
26
+ ; CHECK -LABEL: test6:
27
+ ; CHECK : clw a5, 0(ca5)
29
28
entry:
30
29
%0 = load i32 , i32 addrspace (200 )* %a0 , align 4 , !tbaa !5
31
30
%1 = load i32 , i32 addrspace (200 )* %a1 , align 4 , !tbaa !5
@@ -45,11 +44,11 @@ entry:
45
44
define dso_local chericcallcce i32 @test8 (i32 addrspace (200 )* nocapture readonly %a0 , i32 addrspace (200 )* nocapture readonly %a1 , i32 addrspace (200 )* nocapture readonly %a2 , i32 addrspace (200 )* nocapture readonly %a3 , i32 addrspace (200 )* nocapture readonly %a4 , i32 addrspace (200 )* nocapture readonly %a5 , i32 addrspace (200 )* nocapture readonly %a6 , i32 addrspace (200 )* nocapture readonly %a7 ) local_unnamed_addr addrspace (200 ) #1 {
46
45
; Check that the last argument (used in the multiply) is loaded from offset 8
47
46
; in the stack-argument capability.
48
- ; BOTH -LABEL: test8:
49
- ; BOTH : clc [[CREG:[a-z]+[0-9]+]], 8(ct0)
50
- ; BOTH : clw [[IREG:[a-z]+[0-9]+]], 0([[CREG]])
51
- ; BOTH : mul
52
- ; BOTH -SAME: [[IREG]]
47
+ ; CHECK -LABEL: test8:
48
+ ; CHECK : clc [[CREG:[a-z]+[0-9]+]], 8(ct0)
49
+ ; CHECK : clw [[IREG:[a-z]+[0-9]+]], 0([[CREG]])
50
+ ; CHECK : mul
51
+ ; CHECK -SAME: [[IREG]]
53
52
entry:
54
53
%0 = load i32 , i32 addrspace (200 )* %a0 , align 4 , !tbaa !5
55
54
%1 = load i32 , i32 addrspace (200 )* %a1 , align 4 , !tbaa !5
@@ -82,16 +81,16 @@ declare void @llvm.lifetime.end.p200i8(i64 immarg, i8 addrspace(200)* nocapture)
82
81
define dso_local i32 @testcall8 () local_unnamed_addr addrspace (200 ) #2 {
83
82
entry:
84
83
; Check that we have the right relocations and stack layout.
85
- ; BOTH -LABEL: testcall8:
86
- ; BOTH : auicgp ct0, %cheriot_compartment_hi(testcall8.stack_arg)
87
- ; BOTH : cincoffset ct0, ct0, %cheriot_compartment_lo_i
88
- ; BOTH : csetbounds ct0, ct0, %cheriot_compartment_size(testcall8.stack_arg)
89
- ; BOTH : csc ct0, 8(csp)
90
- ; BOTH : auipcc ct1, %cheriot_compartment_hi(__import_other_test8callee)
91
- ; BOTH : clc ct1, %cheriot_compartment_lo_i
92
- ; BOTH : auipcc ct2, %cheriot_compartment_hi(.compartment_switcher)
93
- ; BOTH : clc ct2, %cheriot_compartment_lo_i
94
- ; BOTH : cjalr ct2
84
+ ; CHECK -LABEL: testcall8:
85
+ ; CHECK : auicgp ct0, %cheriot_compartment_hi(testcall8.stack_arg)
86
+ ; CHECK : cincoffset ct0, ct0, %cheriot_compartment_lo_i
87
+ ; CHECK : csetbounds ct0, ct0, %cheriot_compartment_size(testcall8.stack_arg)
88
+ ; CHECK : csc ct0, 8(csp)
89
+ ; CHECK : auipcc ct1, %cheriot_compartment_hi(__import_other_test8callee)
90
+ ; CHECK : clc ct1, %cheriot_compartment_lo_i
91
+ ; CHECK : auipcc ct2, %cheriot_compartment_hi(.compartment_switcher)
92
+ ; CHECK : clc ct2, %cheriot_compartment_lo_i
93
+ ; CHECK : cjalr ct2
95
94
%args = alloca [8 x i32 ], align 4 , addrspace (200 )
96
95
%0 = bitcast [8 x i32 ] addrspace (200 )* %args to i8 addrspace (200 )*
97
96
call void @llvm.lifetime.start.p200i8 (i64 32 , i8 addrspace (200 )* nonnull %0 ) #5
@@ -133,39 +132,39 @@ attributes #6 = { minsize nounwind optsize }
133
132
134
133
; Check that we have the right import and export tables.
135
134
136
- ; BOTH : .section .compartment_exports,"aR",@progbits
137
- ; BOTH : .type __export_example_test2,@object
138
- ; BOTH : .globl __export_example_test2
139
- ; BOTH : .p2align 2
140
- ; BOTH :__export_example_test2:
141
- ; BOTH : .half test2-__compartment_pcc_start
142
- ; BOTH : .byte 0
143
- ; BOTH : .byte 2
144
- ; BOTH : .size __export_example_test2, 4
145
- ; BOTH : .type __export_example_test6,@object
146
- ; BOTH : .globl __export_example_test6
147
- ; BOTH : .p2align 2
148
- ; BOTH :__export_example_test6:
149
- ; BOTH : .half test6-__compartment_pcc_start
150
- ; BOTH : .byte 0
151
- ; BOTH : .byte 6
152
- ; BOTH : .size __export_example_test6, 4
153
- ; BOTH : .type __export_example_test8,@object
154
- ; BOTH : .globl __export_example_test8
155
- ; BOTH : .p2align 2
156
- ; BOTH :__export_example_test8:
157
- ; BOTH : .half test8-__compartment_pcc_start
158
- ; BOTH : .byte 0
159
- ; BOTH : .byte 7
160
- ; BOTH : .size __export_example_test8, 4
161
- ; BOTH : .section .compartment_imports,"aG",@progbits,__import_other_test8callee,comdat
162
- ; BOTH : .type __import_other_test8callee,@object
163
- ; BOTH : .weak __import_other_test8callee
164
- ; BOTH : .p2align 3
165
- ; BOTH :__import_other_test8callee:
166
- ; BOTH : .word __export_other_test8callee
135
+ ; CHECK : .section .compartment_exports,"aR",@progbits
136
+ ; CHECK : .type __export_example_test2,@object
137
+ ; CHECK : .globl __export_example_test2
138
+ ; CHECK : .p2align 2
139
+ ; CHECK :__export_example_test2:
140
+ ; CHECK : .half test2-__compartment_pcc_start
141
+ ; CHECK : .byte 0
142
+ ; CHECK : .byte 2
143
+ ; CHECK : .size __export_example_test2, 4
144
+ ; CHECK : .type __export_example_test6,@object
145
+ ; CHECK : .globl __export_example_test6
146
+ ; CHECK : .p2align 2
147
+ ; CHECK :__export_example_test6:
148
+ ; CHECK : .half test6-__compartment_pcc_start
149
+ ; CHECK : .byte 0
150
+ ; CHECK : .byte 6
151
+ ; CHECK : .size __export_example_test6, 4
152
+ ; CHECK : .type __export_example_test8,@object
153
+ ; CHECK : .globl __export_example_test8
154
+ ; CHECK : .p2align 2
155
+ ; CHECK :__export_example_test8:
156
+ ; CHECK : .half test8-__compartment_pcc_start
157
+ ; CHECK : .byte 0
158
+ ; CHECK : .byte 7
159
+ ; CHECK : .size __export_example_test8, 4
160
+ ; CHECK : .section .compartment_imports,"aG",@progbits,__import_other_test8callee,comdat
161
+ ; CHECK : .type __import_other_test8callee,@object
162
+ ; CHECK : .weak __import_other_test8callee
163
+ ; CHECK : .p2align 3
164
+ ; CHECK :__import_other_test8callee:
165
+ ; CHECK : .word __export_other_test8callee
167
166
; This is not a libcall, so it shouldn't have any add to set low bits in this
168
167
; pointer.
169
- ; BOTH -NOT: +
170
- ; BOTH : .word 0
171
- ; BOTH : .size __import_other_test8callee, 8
168
+ ; CHECK -NOT: +
169
+ ; CHECK : .word 0
170
+ ; CHECK : .size __import_other_test8callee, 8
0 commit comments