diff options
author | Ian Moffett <ian@osmora.org> | 2025-04-10 00:58:00 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-04-10 01:24:20 -0400 |
commit | 0feda1d4af308f7bcba435e313fcc06ef2c59132 (patch) | |
tree | aaad0af53d33f50ecb91a630b759ef1c55c5b448 | |
parent | d869a6b0c3315de350799f4f1fdd4bc3538b0855 (diff) |
tools/tests: Add tools and tests
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | tests/test.S | 12 | ||||
-rw-r--r-- | tools/machchk.sh | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/test.S b/tests/test.S new file mode 100644 index 0000000..df907a6 --- /dev/null +++ b/tests/test.S @@ -0,0 +1,12 @@ +#include <sys/sycall.h> + + .text + .globl _start +_start: + nop /* Debug start (step-in here) */ + movq $0xDEADBEEF, %rdx + nop /* Debug end, exit start (step-out here) */ + movq $SYS_EXIT, %rax + xor %rdi, %rdi + syscall + ud2 diff --git a/tools/machchk.sh b/tools/machchk.sh new file mode 100644 index 0000000..fc8952e --- /dev/null +++ b/tools/machchk.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +getdefs() { + gcc -dM -E - </dev/null | grep -E \ + "(__x86_64__|__amd64__|__i386__|__arm__|\ + __aarch64__|__linux__|__WIN32__|__APPLE__)" +} + +echo "Dumping GCC machdep defines..." +echo "****************************************************" +getdefs +echo "****************************************************" |