tests: tcg: add basic tests for e2k

This commit is contained in:
Alibek Omarov 2020-11-16 15:57:59 +03:00 committed by Denis Drakhnia
parent 45e3735d04
commit 3cba18b9a5
3 changed files with 25 additions and 0 deletions

1
configure vendored
View File

@ -1866,6 +1866,7 @@ fi
: ${cross_cc_sparc="$cross_cc_sparc64"}
: ${cross_cc_cflags_sparc="-m32 -mcpu=supersparc"}
: ${cross_cc_cflags_x86_64="-m64"}
: ${cross_cc_e2k="e2k-linux-cc"}
compute_target_variable() {
if eval test -n "\"\${cross_prefix_$1}\""; then

View File

@ -0,0 +1,15 @@
# -*- Mode: makefile -*-
#
# Elbrus 2000 tests
E2K_SRC=$(SRC_PATH)/tests/tcg/e2k
VPATH+=$(E2K_SRC)
E2K_TESTS=hello-e2k
TESTS+=$(E2K_TESTS)
#
# hello-e2k is a barebones app
#
hello-e2k: CFLAGS+=-ffreestanding
hello-e2k: LDFLAGS+=-nostdlib

View File

@ -0,0 +1,9 @@
#include <asm/e2k_api.h>
#include <asm/unistd.h>
#define MSG "Hello, world!\n"
void _start(void) {
__E2K_SYSCALL_3(LINUX_SYSCALL64_TRAPNUM, __NR_write, 1, MSG, sizeof(MSG));
__E2K_SYSCALL_1(LINUX_SYSCALL64_TRAPNUM, __NR_exit, 0);
}