ast-exporter: Convert RISC-V vector tuple types - #2008
Open
crasbe wants to merge 1 commit into
Open
Conversation
thedataking
approved these changes
Sep 10, 2026
thedataking
left a comment
Contributor
There was a problem hiding this comment.
Thanks for catching this!
Could you add a small regression snapshot for transpiling an empty C file with --target=riscv32? Existing CI already has LLVM 17 and 18, so this should fit in tests/snapshots.rs without workflow changes. A standalone test
passing the target argument directly would be fine.
Author
|
Unfortunately I'm not quite sure how to do that? From my understanding, this is what I would have to add to diff --git a/c2rust-transpile/tests/snapshots.rs b/c2rust-transpile/tests/snapshots.rs
index fb47993bf..482b43182 100644
--- a/c2rust-transpile/tests/snapshots.rs
+++ b/c2rust-transpile/tests/snapshots.rs
@@ -532,6 +532,12 @@ fn test_vm_x86() {
transpile("vm_x86.c").arch_specific(true).run();
}
+#[test]
+fn test_empty() {
+ #[cfg(target_arch = "riscv32")]
+ transpile("empty.h").arch_specific(true).run();
+}
+
// os-specific
#[test]But I don't understand how to generate the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Similarly to #692 and #693, LLVM 17 introduced new vector tuple types for RISC-V that cause build issues.
Context: in RIOT OS, we are currently updating our build container that now uses Ubuntu 26.04LTS, which ships with at least LLVM 17 and there we ran into this issue.
Unrelated note: there are some code paths for LLVM<15 versions, which are not supported anymore according to the README, I guess they could be deleted?
Minimal Example
Note: I bumped the version to distinguish between the installations.
Behavior with
master:Behavior with this PR:
Less Minimal Example
To see whether or not the types are actually interpreted correctly, I created a less minimal example that defines four functions that use the tuple types.
The transpilation still fails because there is no support for the resulting vector types, but it shows that the vectors are interpreted correctly, there is just no further support for them.
This is beyond the scope of the PR though I guess.
From the error message together with the according type.