about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-08 13:42:46 -0400
committerOneirical <manchot@videotron.ca>2024-07-17 15:33:05 -0400
commita47ca1913469e574369e6ddc28f124e5c9e9e13a (patch)
tree7c80ac82065c85e61150b1b5ee1065a2146c2740
parentf00f85091904530ee8f5b29251c53571e0062a76 (diff)
downloadrust-a47ca1913469e574369e6ddc28f124e5c9e9e13a.tar.gz
rust-a47ca1913469e574369e6ddc28f124e5c9e9e13a.zip
rewrite extern-fn-with-extern-types to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/extern-fn-with-extern-types/Makefile6
-rw-r--r--tests/run-make/extern-fn-with-extern-types/rmake.rs16
3 files changed, 16 insertions, 7 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 2e26f9344b8..e016d3f1139 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -29,7 +29,6 @@ run-make/extern-fn-generic/Makefile
 run-make/extern-fn-mangle/Makefile
 run-make/extern-fn-reachable/Makefile
 run-make/extern-fn-struct-passing-abi/Makefile
-run-make/extern-fn-with-extern-types/Makefile
 run-make/extern-fn-with-packed-struct/Makefile
 run-make/extern-fn-with-union/Makefile
 run-make/extern-multiple-copies/Makefile
diff --git a/tests/run-make/extern-fn-with-extern-types/Makefile b/tests/run-make/extern-fn-with-extern-types/Makefile
deleted file mode 100644
index 07ec503aaae..00000000000
--- a/tests/run-make/extern-fn-with-extern-types/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,ctest)
-	$(RUSTC) test.rs
-	$(call RUN,test) || exit 1
diff --git a/tests/run-make/extern-fn-with-extern-types/rmake.rs b/tests/run-make/extern-fn-with-extern-types/rmake.rs
new file mode 100644
index 00000000000..02521ae2cdb
--- /dev/null
+++ b/tests/run-make/extern-fn-with-extern-types/rmake.rs
@@ -0,0 +1,16 @@
+// This test checks the functionality of foreign function interface (FFI) where Rust
+// must call upon a C library defining functions, where these functions also use custom
+// types defined by the C file. In addition to compilation being successful, the binary
+// should also successfully execute.
+// See https://github.com/rust-lang/rust/pull/44295
+
+//@ 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("ctest");
+    rustc().input("test.rs").run();
+    run("test");
+}