Compiling tests for nolibc #1707
MendocinoWhiteDeer
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Does anyone have a recommended way to compile nolibc tests?
Basically I am using the same flags as if I was compiling a normal nolibc executable but with compile-test instead of compile.
It seems I have to go through many of the tests in a single file and resolve symbol conflicts by appending
@if(env::LIBC)to most of the tests. And then it still expects an entry point (like _start on Linux).assertalso no longer works.I did my own thing here https://gist.github.com/MendocinoWhiteDeer/94217e79cae62a0653cf75e61336059e using inline assembly to write an assert and was able to check math::is_approx without issue (toggling the values and recompiling always produces the correct result).
The reason I care is I want to try my hand at adding nolibc functions to the repo, but I don't have a proper way to verify that the code is correct. I can only do my hacks that are dependent on OS and architecture to check the math functions. Even if I correctly write the functions most other people won't be able to verify that I'm right without doing some gymnastics.
This might seem like a big question that the compiler just isn't ready for yet (or I'm simply overlooking something), so I apologize in advance. But I think you would just have to change out the "main" function that compile-test has hard-coded for the entry point that you need depending on the platform.
Beta Was this translation helpful? Give feedback.
All reactions