tests: tcg: add basic tests for e2k
This commit is contained in:
parent
45e3735d04
commit
3cba18b9a5
1
configure
vendored
1
configure
vendored
@ -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
|
||||
|
15
tests/tcg/e2k/Makefile.target
Normal file
15
tests/tcg/e2k/Makefile.target
Normal 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
|
9
tests/tcg/e2k/hello-e2k.c
Normal file
9
tests/tcg/e2k/hello-e2k.c
Normal 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);
|
||||
}
|
Loading…
Reference in New Issue
Block a user