summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromyatnikov <evgsyr@gmail.com>2023-04-25 18:11:21 +0200
committerEugene Syromyatnikov <evgsyr@gmail.com>2023-04-27 14:54:00 +0200
commit3ed268876dd5b65263449f9aeb18a1cc2604c707 (patch)
treefd6ebe34ac4b37148aba7b830fecc6fabfb68d2c
parent485968ccbb1f3dd6af1c47c52ab8fd0a0e05aa65 (diff)
downloadstrace-esyr/tests-prctl-sve-fix.tar.gz
tests/prctl-sve: fix prctl(PR_SVE_GET_VL) return expected value printingesyr/tests-prctl-sve-fix
* tests/prctl-sve.c: Print the expected return value string based on the value returned, similarly to the way it is done in tests/prctl-sme.c:print_sme_vl_arg(). Fixes: v5.13~8 "tests: improve test coverage of prctl syscall decoder" Closes: https://github.com/strace/strace/issues/251
-rw-r--r--tests/prctl-sve.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/tests/prctl-sve.c b/tests/prctl-sve.c
index 4cef149cf..216ebfc3f 100644
--- a/tests/prctl-sve.c
+++ b/tests/prctl-sve.c
@@ -43,12 +43,28 @@ main(void)
(unsigned long) 0xff, sprintrc(rc));
rc = syscall(__NR_prctl, PR_SVE_GET_VL);
- printf("prctl(PR_SVE_GET_VL) = %s", sprintrc(rc));
+ printf("prctl(PR_SVE_GET_VL) = ");
if (rc >= 0) {
- printf(" (PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|%#lx)",
- (unsigned long) 0xff);
+ printf("%#lx", rc);
+ if (rc > 0xffff) {
+ printf(" (");
+ if (rc & PR_SVE_SET_VL_ONEXEC)
+ printf("PR_SVE_SET_VL_ONEXEC");
+ if (rc & PR_SVE_VL_INHERIT) {
+ printf("%sPR_SVE_VL_INHERIT",
+ rc & PR_SVE_SET_VL_ONEXEC ? "|" : "");
+ }
+ if (rc & ~0x6ffffU) {
+ printf("%s%#lx",
+ rc & 0x60000 ? "|" : "", rc & ~0x6ffffU);
+ }
+ printf("|%#lx)\n", rc & 0xffffU);
+ } else {
+ puts("");
+ }
+ } else {
+ puts(sprintrc(rc));
}
- puts("");
puts("+++ exited with 0 +++");
return 0;