From fd7bc593634a3402a38ebe8c8d35287139e19a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Wed, 27 Mar 2024 23:34:16 +0000 Subject: [PATCH] Port argument-non-c-like-enum to Rust --- .../arguments-non-c-like-enum/Makefile | 8 -------- .../arguments-non-c-like-enum/rmake.rs | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) delete mode 100644 tests/run-make/arguments-non-c-like-enum/Makefile create mode 100644 tests/run-make/arguments-non-c-like-enum/rmake.rs diff --git a/tests/run-make/arguments-non-c-like-enum/Makefile b/tests/run-make/arguments-non-c-like-enum/Makefile deleted file mode 100644 index 0c8d8bf3acc..00000000000 --- a/tests/run-make/arguments-non-c-like-enum/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -all: - $(RUSTC) --crate-type=staticlib nonclike.rs - $(CC) test.c $(call STATICLIB,nonclike) $(call OUT_EXE,test) \ - $(EXTRACFLAGS) $(EXTRACXXFLAGS) - $(call RUN,test) diff --git a/tests/run-make/arguments-non-c-like-enum/rmake.rs b/tests/run-make/arguments-non-c-like-enum/rmake.rs new file mode 100644 index 00000000000..624a7fb2251 --- /dev/null +++ b/tests/run-make/arguments-non-c-like-enum/rmake.rs @@ -0,0 +1,20 @@ +//! Check that non-trivial `repr(C)` enum in Rust has valid C layout. +//@ ignore-cross-compile + +extern crate run_make_support; + +use run_make_support::{cc, extra_c_flags, extra_cxx_flags, run, rustc, static_lib}; + +pub fn main() { + use std::path::Path; + + rustc().input("nonclike.rs").crate_type("staticlib").run(); + cc().input("test.c") + .input(static_lib("nonclike")) + .out_exe("test") + .args(&extra_c_flags()) + .args(&extra_cxx_flags()) + .inspect(|cmd| eprintln!("{cmd:?}")) + .run(); + run("test"); +}