Test "Scalable Vector Extension (SVE) support." on arm64
Change-Id: I3abaca932985a06b06887b962e769f2eac96c738
This commit is contained in:
committed by
Masamichi Takagi
parent
6810506c3d
commit
7da5fede8b
56
test/sve/src/022.c
Normal file
56
test/sve/src/022.c
Normal file
@@ -0,0 +1,56 @@
|
||||
/* 022.c COPYRIGHT FUJITSU LIMITED 2017-2019 */
|
||||
/* Use execve() VL check if setting INHERIT flags.
|
||||
* (execve target is #1 testcase)
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "common.h"
|
||||
|
||||
extern char **environ;
|
||||
TEST_FUNC(TEST_NUMBER, vl, vq, unused1, tp_argv)
|
||||
{
|
||||
char *self = (char *)tp_argv[0];
|
||||
struct fpsimd_sve_state(vq) rd_buf;
|
||||
struct fpsimd_sve_state(vq) wr_buf;
|
||||
unsigned int fpscr[2] = { 0, 0 };
|
||||
char *const execve_args[] = {
|
||||
"", "1", NULL
|
||||
};
|
||||
int ret = -1;
|
||||
|
||||
print_test_overview(tp_num);
|
||||
|
||||
memset(&rd_buf, 0, sizeof(rd_buf));
|
||||
memset(&wr_buf, 0, sizeof(wr_buf));
|
||||
|
||||
gen_test_sve(&wr_buf, vq);
|
||||
write_sve(&wr_buf, vq, fpscr);
|
||||
read_sve(&rd_buf, vq, fpscr);
|
||||
|
||||
if (sve_compare(&wr_buf, &rd_buf, vq)) {
|
||||
printf("Dirty SVE-register before executing execve(), NG.\n");
|
||||
goto out;
|
||||
}
|
||||
printf("Dirty SVE-register before executing execve(), OK.\n");
|
||||
|
||||
if (set_and_compare_vl(gen_set_vl(vl) | PR_SVE_VL_INHERIT)) {
|
||||
printf("prctl: error.\n");
|
||||
goto out;
|
||||
}
|
||||
|
||||
printf("=== look at the contents of the register "
|
||||
"since run execve. ===\n");
|
||||
|
||||
ret = execve(self, execve_args, environ);
|
||||
if (ret == -1) {
|
||||
perror("execve()");
|
||||
} else {
|
||||
ret = -1;
|
||||
printf("Why return execve() ???\n");
|
||||
}
|
||||
out:
|
||||
printf("RESULT: NG.\n");
|
||||
return ret;
|
||||
}
|
||||
Reference in New Issue
Block a user