Skip to content

Commit 9fac4a3

Browse files
authored
[FMV][AArch64] Add runtime test for memtag. (#173)
There are no FEAT_MTE2 instructions available at EL0, therefore this test is expected to UPASS on systems which support FEAT_MTE but don't support FEAT_MTE2.
1 parent 07f0e03 commit 9fac4a3

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

SingleSource/UnitTests/AArch64/acle-fmv-features.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,15 @@ CHECK(mops, mops, mops, false, {
369369
: : "cc", "memory"
370370
);
371371
})
372+
// We can't use any FEAT_MTE2 instruction in this test since they are undefined
373+
// at EL0. Therefore passing IS_EXEMPT = true here allows the default version to
374+
// UPASS on a system which doesn't have FEAT_MTE2 but has FEAT_MTE.
375+
CHECK(memtag, memtag, memtag, true, {
376+
asm volatile (
377+
"irg x0, sp"
378+
: : : "x0"
379+
);
380+
})
372381

373382
static bool safe_try_feature(bool (*try_feature)(void), bool is_exempt) {
374383
int child = fork();
@@ -428,6 +437,7 @@ int main(int, const char **) {
428437
check_sme_f64f64();
429438
check_sme_i16i64();
430439
check_mops();
440+
check_memtag();
431441

432442
return any_fails ? -1 : 0;
433443
}

SingleSource/UnitTests/AArch64/acle-fmv-features.reference_output

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ sm4
4343
sme-f64f64
4444
sme-i16i64
4545
mops
46+
memtag
4647
exit 0

0 commit comments

Comments
 (0)