rewrite return-non-c-like-enum-from-c to rmake

This commit is contained in:
Oneirical 2024-07-12 14:33:16 -04:00
parent 3811f40d27
commit 5b1860a24e
3 changed files with 17 additions and 7 deletions

View File

@ -66,7 +66,6 @@ run-make/no-alloc-shim/Makefile
run-make/no-builtins-attribute/Makefile run-make/no-builtins-attribute/Makefile
run-make/no-duplicate-libs/Makefile run-make/no-duplicate-libs/Makefile
run-make/panic-abort-eh_frame/Makefile run-make/panic-abort-eh_frame/Makefile
run-make/pass-non-c-like-enum-to-c/Makefile
run-make/pdb-buildinfo-cl-cmd/Makefile run-make/pdb-buildinfo-cl-cmd/Makefile
run-make/pgo-gen-lto/Makefile run-make/pgo-gen-lto/Makefile
run-make/pgo-gen-no-imp-symbols/Makefile run-make/pgo-gen-no-imp-symbols/Makefile

View File

@ -1,6 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,test)
$(RUSTC) nonclike.rs -L$(TMPDIR) -ltest
$(call RUN,nonclike)

View File

@ -0,0 +1,17 @@
// A reversed version of the `return-non-c-like-enum` test, though
// this time, the C code is the library, and the Rust code compiles
// into the executable. Once again, enum variants should be treated
// like an union of structs, which should prevent segfaults or
// unexpected results.
// See https://github.com/rust-lang/rust/issues/68190
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{build_native_static_lib, run, rustc};
fn main() {
build_native_static_lib("test");
rustc().input("nonclike.rs").arg("-ltest").run();
run("nonclike");
}