Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add core::intrinsics::transmute intrinsics test #49

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

Oneirical
Copy link
Contributor

Part of #45.

Presenting this to narrow down if this is what you are looking for in intrinsics tests. The 3 transmute test cases are inspired from the transmute official docs.

A possible improvement I noticed for the test suite is the wall of:

// snip
run_test! {intrinsics,ctpop,stable}
run_test! {intrinsics,atomics,stable}
run_test! {intrinsics,alloc,stable}
run_test! {intrinsics,size_of_val,stable}
run_test! {intrinsics,malloc,stable}
run_test! {intrinsics,offset_of,stable}
// snip

in compile_test.rs. Addressing this could be the subject of another PR.

@Oneirical
Copy link
Contributor Author

I am getting a failure in the CI, though I am not sure if this is due to a mistake in the test or simply due to transmute not being supported yet.

@FractalFir
Copy link
Owner

The test seems to be OK, it just tripped up an additional warning.

Some time ago, I added new checks, which attempt to find type errors related to pointers. This requires changing the type of a pointer to be explicit(to use the CastPtr IR node).

I must have accidentally missed one of special cases of transmutation(fn ptr to raw ptr) when I updated my backend to use explicit pointer casts.

Since the pointer cast was implicit, the codegen detected a potential issue, and printed a warning to stderr. Since a warning was printed, the test is considered a "failure", even tough it works.

@FractalFir FractalFir merged commit 71ee234 into FractalFir:main Aug 5, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants