From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../run-make/raw-dylib-inline-cross-dylib/Makefile | 31 ---------------------- .../raw-dylib-inline-cross-dylib/driver.rs | 21 --------------- .../raw-dylib-inline-cross-dylib/extern_1.c | 11 -------- .../raw-dylib-inline-cross-dylib/extern_2.c | 6 ----- .../run-make/raw-dylib-inline-cross-dylib/lib.rs | 21 --------------- .../raw-dylib-inline-cross-dylib/lib_wrapper.rs | 6 ----- .../raw-dylib-inline-cross-dylib/output.txt | 6 ----- 7 files changed, 102 deletions(-) delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/Makefile delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/driver.rs delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/extern_1.c delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/extern_2.c delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/lib.rs delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/lib_wrapper.rs delete mode 100644 src/test/run-make/raw-dylib-inline-cross-dylib/output.txt (limited to 'src/test/run-make/raw-dylib-inline-cross-dylib') 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 - -__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 - -__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 -- cgit v1.2.3