Skip to content

Commit 53283dc

Browse files
authored
[PAC][test] Add tests against Linux triples for auth/resign lowering (llvm#100744)
The lowering implementation and tests against arm64e-apple-darwin triple were added previously in llvm#79024.
1 parent 7f3dcf4 commit 53283dc

File tree

3 files changed

+241
-203
lines changed

3 files changed

+241
-203
lines changed

llvm/test/CodeGen/AArch64/ptrauth-fpac.ll

+51-49
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs | FileCheck %s --check-prefixes=ALL,NOFPAC
3-
; RUN: llc < %s -mtriple arm64e-apple-darwin -mattr=+fpac -verify-machineinstrs | FileCheck %s --check-prefixes=ALL,FPAC
2+
; RUN: llc < %s -mtriple arm64e-apple-darwin -verify-machineinstrs | FileCheck %s -DL="L" --check-prefixes=ALL,NOFPAC
3+
; RUN: llc < %s -mtriple arm64e-apple-darwin -mattr=+fpac -verify-machineinstrs | FileCheck %s -DL="L" --check-prefixes=ALL,FPAC
4+
; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -verify-machineinstrs | FileCheck %s -DL=".L" --check-prefixes=ALL,NOFPAC
5+
; RUN: llc < %s -mtriple aarch64-linux-gnu -mattr=+pauth -mattr=+fpac -verify-machineinstrs | FileCheck %s -DL=".L" --check-prefixes=ALL,FPAC
46

57
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
68

79
define i64 @test_auth_ia(i64 %arg, i64 %arg1) {
810
; ALL-LABEL: test_auth_ia:
9-
; ALL: ; %bb.0:
11+
; ALL: %bb.0:
1012
; ALL-NEXT: mov x16, x0
1113
; ALL-NEXT: autia x16, x1
1214
; ALL-NEXT: mov x0, x16
@@ -17,7 +19,7 @@ define i64 @test_auth_ia(i64 %arg, i64 %arg1) {
1719

1820
define i64 @test_auth_ia_zero(i64 %arg) {
1921
; ALL-LABEL: test_auth_ia_zero:
20-
; ALL: ; %bb.0:
22+
; ALL: %bb.0:
2123
; ALL-NEXT: mov x16, x0
2224
; ALL-NEXT: autiza x16
2325
; ALL-NEXT: mov x0, x16
@@ -28,7 +30,7 @@ define i64 @test_auth_ia_zero(i64 %arg) {
2830

2931
define i64 @test_auth_ib(i64 %arg, i64 %arg1) {
3032
; ALL-LABEL: test_auth_ib:
31-
; ALL: ; %bb.0:
33+
; ALL: %bb.0:
3234
; ALL-NEXT: mov x16, x0
3335
; ALL-NEXT: autib x16, x1
3436
; ALL-NEXT: mov x0, x16
@@ -39,7 +41,7 @@ define i64 @test_auth_ib(i64 %arg, i64 %arg1) {
3941

4042
define i64 @test_auth_ib_zero(i64 %arg) {
4143
; ALL-LABEL: test_auth_ib_zero:
42-
; ALL: ; %bb.0:
44+
; ALL: %bb.0:
4345
; ALL-NEXT: mov x16, x0
4446
; ALL-NEXT: autizb x16
4547
; ALL-NEXT: mov x0, x16
@@ -50,7 +52,7 @@ define i64 @test_auth_ib_zero(i64 %arg) {
5052

5153
define i64 @test_auth_da(i64 %arg, i64 %arg1) {
5254
; ALL-LABEL: test_auth_da:
53-
; ALL: ; %bb.0:
55+
; ALL: %bb.0:
5456
; ALL-NEXT: mov x16, x0
5557
; ALL-NEXT: autda x16, x1
5658
; ALL-NEXT: mov x0, x16
@@ -61,7 +63,7 @@ define i64 @test_auth_da(i64 %arg, i64 %arg1) {
6163

6264
define i64 @test_auth_da_zero(i64 %arg) {
6365
; ALL-LABEL: test_auth_da_zero:
64-
; ALL: ; %bb.0:
66+
; ALL: %bb.0:
6567
; ALL-NEXT: mov x16, x0
6668
; ALL-NEXT: autdza x16
6769
; ALL-NEXT: mov x0, x16
@@ -72,7 +74,7 @@ define i64 @test_auth_da_zero(i64 %arg) {
7274

7375
define i64 @test_auth_db(i64 %arg, i64 %arg1) {
7476
; ALL-LABEL: test_auth_db:
75-
; ALL: ; %bb.0:
77+
; ALL: %bb.0:
7678
; ALL-NEXT: mov x16, x0
7779
; ALL-NEXT: autdb x16, x1
7880
; ALL-NEXT: mov x0, x16
@@ -83,7 +85,7 @@ define i64 @test_auth_db(i64 %arg, i64 %arg1) {
8385

8486
define i64 @test_auth_db_zero(i64 %arg) {
8587
; ALL-LABEL: test_auth_db_zero:
86-
; ALL: ; %bb.0:
88+
; ALL: %bb.0:
8789
; ALL-NEXT: mov x16, x0
8890
; ALL-NEXT: autdzb x16
8991
; ALL-NEXT: mov x0, x16
@@ -96,23 +98,23 @@ define i64 @test_auth_db_zero(i64 %arg) {
9698
; the validity of a signature.
9799
define i64 @test_resign_ia_ia(i64 %arg, i64 %arg1, i64 %arg2) {
98100
; NOFPAC-LABEL: test_resign_ia_ia:
99-
; NOFPAC: ; %bb.0:
101+
; NOFPAC: %bb.0:
100102
; NOFPAC-NEXT: mov x16, x0
101103
; NOFPAC-NEXT: autia x16, x1
102104
; NOFPAC-NEXT: mov x17, x16
103105
; NOFPAC-NEXT: xpaci x17
104106
; NOFPAC-NEXT: cmp x16, x17
105-
; NOFPAC-NEXT: b.eq Lauth_success_0
107+
; NOFPAC-NEXT: b.eq [[L]]auth_success_0
106108
; NOFPAC-NEXT: mov x16, x17
107-
; NOFPAC-NEXT: b Lresign_end_0
109+
; NOFPAC-NEXT: b [[L]]resign_end_0
108110
; NOFPAC-NEXT: Lauth_success_0:
109111
; NOFPAC-NEXT: pacia x16, x2
110112
; NOFPAC-NEXT: Lresign_end_0:
111113
; NOFPAC-NEXT: mov x0, x16
112114
; NOFPAC-NEXT: ret
113115
;
114116
; FPAC-LABEL: test_resign_ia_ia:
115-
; FPAC: ; %bb.0:
117+
; FPAC: %bb.0:
116118
; FPAC-NEXT: mov x16, x0
117119
; FPAC-NEXT: autia x16, x1
118120
; FPAC-NEXT: pacia x16, x2
@@ -124,23 +126,23 @@ define i64 @test_resign_ia_ia(i64 %arg, i64 %arg1, i64 %arg2) {
124126

125127
define i64 @test_resign_ib_ia(i64 %arg, i64 %arg1, i64 %arg2) {
126128
; NOFPAC-LABEL: test_resign_ib_ia:
127-
; NOFPAC: ; %bb.0:
129+
; NOFPAC: %bb.0:
128130
; NOFPAC-NEXT: mov x16, x0
129131
; NOFPAC-NEXT: autib x16, x1
130132
; NOFPAC-NEXT: mov x17, x16
131133
; NOFPAC-NEXT: xpaci x17
132134
; NOFPAC-NEXT: cmp x16, x17
133-
; NOFPAC-NEXT: b.eq Lauth_success_1
135+
; NOFPAC-NEXT: b.eq [[L]]auth_success_1
134136
; NOFPAC-NEXT: mov x16, x17
135-
; NOFPAC-NEXT: b Lresign_end_1
137+
; NOFPAC-NEXT: b [[L]]resign_end_1
136138
; NOFPAC-NEXT: Lauth_success_1:
137139
; NOFPAC-NEXT: pacia x16, x2
138140
; NOFPAC-NEXT: Lresign_end_1:
139141
; NOFPAC-NEXT: mov x0, x16
140142
; NOFPAC-NEXT: ret
141143
;
142144
; FPAC-LABEL: test_resign_ib_ia:
143-
; FPAC: ; %bb.0:
145+
; FPAC: %bb.0:
144146
; FPAC-NEXT: mov x16, x0
145147
; FPAC-NEXT: autib x16, x1
146148
; FPAC-NEXT: pacia x16, x2
@@ -152,23 +154,23 @@ define i64 @test_resign_ib_ia(i64 %arg, i64 %arg1, i64 %arg2) {
152154

153155
define i64 @test_resign_da_ia(i64 %arg, i64 %arg1, i64 %arg2) {
154156
; NOFPAC-LABEL: test_resign_da_ia:
155-
; NOFPAC: ; %bb.0:
157+
; NOFPAC: %bb.0:
156158
; NOFPAC-NEXT: mov x16, x0
157159
; NOFPAC-NEXT: autda x16, x1
158160
; NOFPAC-NEXT: mov x17, x16
159161
; NOFPAC-NEXT: xpacd x17
160162
; NOFPAC-NEXT: cmp x16, x17
161-
; NOFPAC-NEXT: b.eq Lauth_success_2
163+
; NOFPAC-NEXT: b.eq [[L]]auth_success_2
162164
; NOFPAC-NEXT: mov x16, x17
163-
; NOFPAC-NEXT: b Lresign_end_2
165+
; NOFPAC-NEXT: b [[L]]resign_end_2
164166
; NOFPAC-NEXT: Lauth_success_2:
165167
; NOFPAC-NEXT: pacia x16, x2
166168
; NOFPAC-NEXT: Lresign_end_2:
167169
; NOFPAC-NEXT: mov x0, x16
168170
; NOFPAC-NEXT: ret
169171
;
170172
; FPAC-LABEL: test_resign_da_ia:
171-
; FPAC: ; %bb.0:
173+
; FPAC: %bb.0:
172174
; FPAC-NEXT: mov x16, x0
173175
; FPAC-NEXT: autda x16, x1
174176
; FPAC-NEXT: pacia x16, x2
@@ -180,23 +182,23 @@ define i64 @test_resign_da_ia(i64 %arg, i64 %arg1, i64 %arg2) {
180182

181183
define i64 @test_resign_db_ia(i64 %arg, i64 %arg1, i64 %arg2) {
182184
; NOFPAC-LABEL: test_resign_db_ia:
183-
; NOFPAC: ; %bb.0:
185+
; NOFPAC: %bb.0:
184186
; NOFPAC-NEXT: mov x16, x0
185187
; NOFPAC-NEXT: autdb x16, x1
186188
; NOFPAC-NEXT: mov x17, x16
187189
; NOFPAC-NEXT: xpacd x17
188190
; NOFPAC-NEXT: cmp x16, x17
189-
; NOFPAC-NEXT: b.eq Lauth_success_3
191+
; NOFPAC-NEXT: b.eq [[L]]auth_success_3
190192
; NOFPAC-NEXT: mov x16, x17
191-
; NOFPAC-NEXT: b Lresign_end_3
193+
; NOFPAC-NEXT: b [[L]]resign_end_3
192194
; NOFPAC-NEXT: Lauth_success_3:
193195
; NOFPAC-NEXT: pacia x16, x2
194196
; NOFPAC-NEXT: Lresign_end_3:
195197
; NOFPAC-NEXT: mov x0, x16
196198
; NOFPAC-NEXT: ret
197199
;
198200
; FPAC-LABEL: test_resign_db_ia:
199-
; FPAC: ; %bb.0:
201+
; FPAC: %bb.0:
200202
; FPAC-NEXT: mov x16, x0
201203
; FPAC-NEXT: autdb x16, x1
202204
; FPAC-NEXT: pacia x16, x2
@@ -208,23 +210,23 @@ define i64 @test_resign_db_ia(i64 %arg, i64 %arg1, i64 %arg2) {
208210

209211
define i64 @test_resign_db_ib(i64 %arg, i64 %arg1, i64 %arg2) {
210212
; NOFPAC-LABEL: test_resign_db_ib:
211-
; NOFPAC: ; %bb.0:
213+
; NOFPAC: %bb.0:
212214
; NOFPAC-NEXT: mov x16, x0
213215
; NOFPAC-NEXT: autdb x16, x1
214216
; NOFPAC-NEXT: mov x17, x16
215217
; NOFPAC-NEXT: xpacd x17
216218
; NOFPAC-NEXT: cmp x16, x17
217-
; NOFPAC-NEXT: b.eq Lauth_success_4
219+
; NOFPAC-NEXT: b.eq [[L]]auth_success_4
218220
; NOFPAC-NEXT: mov x16, x17
219-
; NOFPAC-NEXT: b Lresign_end_4
221+
; NOFPAC-NEXT: b [[L]]resign_end_4
220222
; NOFPAC-NEXT: Lauth_success_4:
221223
; NOFPAC-NEXT: pacib x16, x2
222224
; NOFPAC-NEXT: Lresign_end_4:
223225
; NOFPAC-NEXT: mov x0, x16
224226
; NOFPAC-NEXT: ret
225227
;
226228
; FPAC-LABEL: test_resign_db_ib:
227-
; FPAC: ; %bb.0:
229+
; FPAC: %bb.0:
228230
; FPAC-NEXT: mov x16, x0
229231
; FPAC-NEXT: autdb x16, x1
230232
; FPAC-NEXT: pacib x16, x2
@@ -236,23 +238,23 @@ define i64 @test_resign_db_ib(i64 %arg, i64 %arg1, i64 %arg2) {
236238

237239
define i64 @test_resign_db_da(i64 %arg, i64 %arg1, i64 %arg2) {
238240
; NOFPAC-LABEL: test_resign_db_da:
239-
; NOFPAC: ; %bb.0:
241+
; NOFPAC: %bb.0:
240242
; NOFPAC-NEXT: mov x16, x0
241243
; NOFPAC-NEXT: autdb x16, x1
242244
; NOFPAC-NEXT: mov x17, x16
243245
; NOFPAC-NEXT: xpacd x17
244246
; NOFPAC-NEXT: cmp x16, x17
245-
; NOFPAC-NEXT: b.eq Lauth_success_5
247+
; NOFPAC-NEXT: b.eq [[L]]auth_success_5
246248
; NOFPAC-NEXT: mov x16, x17
247-
; NOFPAC-NEXT: b Lresign_end_5
249+
; NOFPAC-NEXT: b [[L]]resign_end_5
248250
; NOFPAC-NEXT: Lauth_success_5:
249251
; NOFPAC-NEXT: pacda x16, x2
250252
; NOFPAC-NEXT: Lresign_end_5:
251253
; NOFPAC-NEXT: mov x0, x16
252254
; NOFPAC-NEXT: ret
253255
;
254256
; FPAC-LABEL: test_resign_db_da:
255-
; FPAC: ; %bb.0:
257+
; FPAC: %bb.0:
256258
; FPAC-NEXT: mov x16, x0
257259
; FPAC-NEXT: autdb x16, x1
258260
; FPAC-NEXT: pacda x16, x2
@@ -264,23 +266,23 @@ define i64 @test_resign_db_da(i64 %arg, i64 %arg1, i64 %arg2) {
264266

265267
define i64 @test_resign_db_db(i64 %arg, i64 %arg1, i64 %arg2) {
266268
; NOFPAC-LABEL: test_resign_db_db:
267-
; NOFPAC: ; %bb.0:
269+
; NOFPAC: %bb.0:
268270
; NOFPAC-NEXT: mov x16, x0
269271
; NOFPAC-NEXT: autdb x16, x1
270272
; NOFPAC-NEXT: mov x17, x16
271273
; NOFPAC-NEXT: xpacd x17
272274
; NOFPAC-NEXT: cmp x16, x17
273-
; NOFPAC-NEXT: b.eq Lauth_success_6
275+
; NOFPAC-NEXT: b.eq [[L]]auth_success_6
274276
; NOFPAC-NEXT: mov x16, x17
275-
; NOFPAC-NEXT: b Lresign_end_6
277+
; NOFPAC-NEXT: b [[L]]resign_end_6
276278
; NOFPAC-NEXT: Lauth_success_6:
277279
; NOFPAC-NEXT: pacdb x16, x2
278280
; NOFPAC-NEXT: Lresign_end_6:
279281
; NOFPAC-NEXT: mov x0, x16
280282
; NOFPAC-NEXT: ret
281283
;
282284
; FPAC-LABEL: test_resign_db_db:
283-
; FPAC: ; %bb.0:
285+
; FPAC: %bb.0:
284286
; FPAC-NEXT: mov x16, x0
285287
; FPAC-NEXT: autdb x16, x1
286288
; FPAC-NEXT: pacdb x16, x2
@@ -292,23 +294,23 @@ define i64 @test_resign_db_db(i64 %arg, i64 %arg1, i64 %arg2) {
292294

293295
define i64 @test_resign_iza_db(i64 %arg, i64 %arg1, i64 %arg2) {
294296
; NOFPAC-LABEL: test_resign_iza_db:
295-
; NOFPAC: ; %bb.0:
297+
; NOFPAC: %bb.0:
296298
; NOFPAC-NEXT: mov x16, x0
297299
; NOFPAC-NEXT: autiza x16
298300
; NOFPAC-NEXT: mov x17, x16
299301
; NOFPAC-NEXT: xpaci x17
300302
; NOFPAC-NEXT: cmp x16, x17
301-
; NOFPAC-NEXT: b.eq Lauth_success_7
303+
; NOFPAC-NEXT: b.eq [[L]]auth_success_7
302304
; NOFPAC-NEXT: mov x16, x17
303-
; NOFPAC-NEXT: b Lresign_end_7
305+
; NOFPAC-NEXT: b [[L]]resign_end_7
304306
; NOFPAC-NEXT: Lauth_success_7:
305307
; NOFPAC-NEXT: pacdb x16, x2
306308
; NOFPAC-NEXT: Lresign_end_7:
307309
; NOFPAC-NEXT: mov x0, x16
308310
; NOFPAC-NEXT: ret
309311
;
310312
; FPAC-LABEL: test_resign_iza_db:
311-
; FPAC: ; %bb.0:
313+
; FPAC: %bb.0:
312314
; FPAC-NEXT: mov x16, x0
313315
; FPAC-NEXT: autiza x16
314316
; FPAC-NEXT: pacdb x16, x2
@@ -320,23 +322,23 @@ define i64 @test_resign_iza_db(i64 %arg, i64 %arg1, i64 %arg2) {
320322

321323
define i64 @test_resign_da_dzb(i64 %arg, i64 %arg1, i64 %arg2) {
322324
; NOFPAC-LABEL: test_resign_da_dzb:
323-
; NOFPAC: ; %bb.0:
325+
; NOFPAC: %bb.0:
324326
; NOFPAC-NEXT: mov x16, x0
325327
; NOFPAC-NEXT: autda x16, x1
326328
; NOFPAC-NEXT: mov x17, x16
327329
; NOFPAC-NEXT: xpacd x17
328330
; NOFPAC-NEXT: cmp x16, x17
329-
; NOFPAC-NEXT: b.eq Lauth_success_8
331+
; NOFPAC-NEXT: b.eq [[L]]auth_success_8
330332
; NOFPAC-NEXT: mov x16, x17
331-
; NOFPAC-NEXT: b Lresign_end_8
333+
; NOFPAC-NEXT: b [[L]]resign_end_8
332334
; NOFPAC-NEXT: Lauth_success_8:
333335
; NOFPAC-NEXT: pacdzb x16
334336
; NOFPAC-NEXT: Lresign_end_8:
335337
; NOFPAC-NEXT: mov x0, x16
336338
; NOFPAC-NEXT: ret
337339
;
338340
; FPAC-LABEL: test_resign_da_dzb:
339-
; FPAC: ; %bb.0:
341+
; FPAC: %bb.0:
340342
; FPAC-NEXT: mov x16, x0
341343
; FPAC-NEXT: autda x16, x1
342344
; FPAC-NEXT: pacdzb x16
@@ -348,20 +350,20 @@ define i64 @test_resign_da_dzb(i64 %arg, i64 %arg1, i64 %arg2) {
348350

349351
define i64 @test_auth_trap_attribute(i64 %arg, i64 %arg1) "ptrauth-auth-traps" {
350352
; NOFPAC-LABEL: test_auth_trap_attribute:
351-
; NOFPAC: ; %bb.0:
353+
; NOFPAC: %bb.0:
352354
; NOFPAC-NEXT: mov x16, x0
353355
; NOFPAC-NEXT: autia x16, x1
354356
; NOFPAC-NEXT: mov x17, x16
355357
; NOFPAC-NEXT: xpaci x17
356358
; NOFPAC-NEXT: cmp x16, x17
357-
; NOFPAC-NEXT: b.eq Lauth_success_9
359+
; NOFPAC-NEXT: b.eq [[L]]auth_success_9
358360
; NOFPAC-NEXT: brk #0xc470
359361
; NOFPAC-NEXT: Lauth_success_9:
360362
; NOFPAC-NEXT: mov x0, x16
361363
; NOFPAC-NEXT: ret
362364
;
363365
; FPAC-LABEL: test_auth_trap_attribute:
364-
; FPAC: ; %bb.0:
366+
; FPAC: %bb.0:
365367
; FPAC-NEXT: mov x16, x0
366368
; FPAC-NEXT: autia x16, x1
367369
; FPAC-NEXT: mov x0, x16

0 commit comments

Comments
 (0)