summaryrefslogtreecommitdiffstats
path: root/src/test/run-make/raw-dylib-inline-cross-dylib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /src/test/run-make/raw-dylib-inline-cross-dylib
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/run-make/raw-dylib-inline-cross-dylib')
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/Makefile31
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs21
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c11
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c6
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs21
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs6
-rw-r--r--src/test/run-make/raw-dylib-inline-cross-dylib/output.txt6
7 files changed, 0 insertions, 102 deletions
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/Makefile b/src/test/run-make/raw-dylib-inline-cross-dylib/Makefile
deleted file mode 100644
index 9e603f958..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/Makefile
+++ /dev/null
@@ -1,31 +0,0 @@
-# Regression test for calling an inline function that uses a raw-dylib function.
-
-# only-windows
-
-include ../../run-make-fulldeps/tools.mk
-
-all:
- $(RUSTC) --crate-type dylib --crate-name raw_dylib_test lib.rs -C prefer-dynamic
- $(RUSTC) --crate-type dylib --crate-name raw_dylib_test_wrapper lib_wrapper.rs -C prefer-dynamic
- $(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)" -C prefer-dynamic
- # Make sure we don't find an import to the functions we expect to be inlined.
- "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -v -e "inline_library_function"
- "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -v -e "inline_library_function_calls_inline"
- # Make sure we do find an import to the functions we expect to be imported.
- "$(LLVM_BIN_DIR)"/llvm-objdump -p $(TMPDIR)/driver.exe | $(CGREP) -e "library_function"
- $(call COMPILE_OBJ,"$(TMPDIR)"/extern_1.obj,extern_1.c)
- $(call COMPILE_OBJ,"$(TMPDIR)"/extern_2.obj,extern_2.c)
-ifdef IS_MSVC
- $(CC) "$(TMPDIR)"/extern_1.obj -link -dll -out:"$(TMPDIR)"/extern_1.dll -noimplib
- $(CC) "$(TMPDIR)"/extern_2.obj -link -dll -out:"$(TMPDIR)"/extern_2.dll -noimplib
-else
- $(CC) "$(TMPDIR)"/extern_1.obj -shared -o "$(TMPDIR)"/extern_1.dll
- $(CC) "$(TMPDIR)"/extern_2.obj -shared -o "$(TMPDIR)"/extern_2.dll
-endif
- $(call RUN,driver) > "$(TMPDIR)"/output.txt
-
-ifdef RUSTC_BLESS_TEST
- cp "$(TMPDIR)"/output.txt output.txt
-else
- $(DIFF) output.txt "$(TMPDIR)"/output.txt
-endif
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs b/src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs
deleted file mode 100644
index f72ded7d9..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![feature(raw_dylib)]
-
-extern crate raw_dylib_test;
-extern crate raw_dylib_test_wrapper;
-
-#[link(name = "extern_2", kind = "raw-dylib")]
-extern {
- fn extern_fn_2();
-}
-
-fn main() {
- // NOTE: The inlined call to `extern_fn_2` links against the function in extern_2.dll instead
- // of extern_1.dll since raw-dylib symbols from the current crate are passed to the linker
- // first, so any ambiguous names will prefer the current crate's definition.
- raw_dylib_test::inline_library_function();
- raw_dylib_test::library_function();
- raw_dylib_test_wrapper::inline_library_function_calls_inline();
- unsafe {
- extern_fn_2();
- }
-}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c b/src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c
deleted file mode 100644
index e5baaf5f0..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <stdio.h>
-
-__declspec(dllexport) void extern_fn_1() {
- printf("extern_fn_1\n");
- fflush(stdout);
-}
-
-__declspec(dllexport) void extern_fn_2() {
- printf("extern_fn_2 in extern_1\n");
- fflush(stdout);
-}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c b/src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c
deleted file mode 100644
index 30aa46922..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdio.h>
-
-__declspec(dllexport) void extern_fn_2() {
- printf("extern_fn_2 in extern_2\n");
- fflush(stdout);
-}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs b/src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs
deleted file mode 100644
index 00c2c1c42..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#![feature(raw_dylib)]
-
-#[link(name = "extern_1", kind = "raw-dylib")]
-extern {
- fn extern_fn_1();
- fn extern_fn_2();
-}
-
-#[inline]
-pub fn inline_library_function() {
- unsafe {
- extern_fn_1();
- extern_fn_2();
- }
-}
-
-pub fn library_function() {
- unsafe {
- extern_fn_2();
- }
-}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs b/src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs
deleted file mode 100644
index 47191b8de..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-extern crate raw_dylib_test;
-
-#[inline]
-pub fn inline_library_function_calls_inline() {
- raw_dylib_test::inline_library_function();
-}
diff --git a/src/test/run-make/raw-dylib-inline-cross-dylib/output.txt b/src/test/run-make/raw-dylib-inline-cross-dylib/output.txt
deleted file mode 100644
index e7009baa0..000000000
--- a/src/test/run-make/raw-dylib-inline-cross-dylib/output.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-extern_fn_1
-extern_fn_2 in extern_2
-extern_fn_2 in extern_1
-extern_fn_1
-extern_fn_2 in extern_2
-extern_fn_2 in extern_2