about summary refs log tree commit diff
path: root/src/test/run-make/raw-dylib-c
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/run-make/raw-dylib-c
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'src/test/run-make/raw-dylib-c')
-rw-r--r--src/test/run-make/raw-dylib-c/Makefile28
-rw-r--r--src/test/run-make/raw-dylib-c/driver.rs5
-rw-r--r--src/test/run-make/raw-dylib-c/extern_1.c28
-rw-r--r--src/test/run-make/raw-dylib-c/extern_2.c6
-rw-r--r--src/test/run-make/raw-dylib-c/lib.rs37
-rw-r--r--src/test/run-make/raw-dylib-c/output.txt6
6 files changed, 0 insertions, 110 deletions
diff --git a/src/test/run-make/raw-dylib-c/Makefile b/src/test/run-make/raw-dylib-c/Makefile
deleted file mode 100644
index f47ab24f4fb..00000000000
--- a/src/test/run-make/raw-dylib-c/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Test the behavior of #[link(.., kind = "raw-dylib")] on windows-msvc
-
-# only-windows
-
-include ../../run-make-fulldeps/tools.mk
-
-all:
-	$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
-	$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
-	$(RUSTC) --crate-type bin --crate-name raw_dylib_test_bin lib.rs
-	$(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
-	"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
-	"$(TMPDIR)"/raw_dylib_test_bin > "$(TMPDIR)"/output_bin.txt
-
-ifdef RUSTC_BLESS_TEST
-	cp "$(TMPDIR)"/output.txt output.txt
-else
-	$(DIFF) output.txt "$(TMPDIR)"/output.txt
-	$(DIFF) output.txt "$(TMPDIR)"/output_bin.txt
-endif
diff --git a/src/test/run-make/raw-dylib-c/driver.rs b/src/test/run-make/raw-dylib-c/driver.rs
deleted file mode 100644
index 4059ede11fc..00000000000
--- a/src/test/run-make/raw-dylib-c/driver.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-extern crate raw_dylib_test;
-
-fn main() {
-    raw_dylib_test::library_function();
-}
diff --git a/src/test/run-make/raw-dylib-c/extern_1.c b/src/test/run-make/raw-dylib-c/extern_1.c
deleted file mode 100644
index 5d695547d0f..00000000000
--- a/src/test/run-make/raw-dylib-c/extern_1.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <stdio.h>
-
-__declspec(dllexport) int extern_variable = 0;
-
-__declspec(dllexport) void extern_fn_1() {
-    printf("extern_fn_1\n");
-    fflush(stdout);
-}
-
-__declspec(dllexport) void extern_fn_2() {
-    printf("extern_fn_2; didn't get the rename\n");
-    fflush(stdout);
-}
-
-__declspec(dllexport) void print_extern_variable() {
-    printf("extern_variable value: %d\n", extern_variable);
-    fflush(stdout);
-}
-
-__declspec(dllexport) void extern_fn_with_long_name() {
-    printf("extern_fn_with_long_name; got the rename\n");
-    fflush(stdout);
-}
-
-__declspec(dllexport) void extern_fn_4() {
-    printf("extern_fn_4\n");
-    fflush(stdout);
-}
diff --git a/src/test/run-make/raw-dylib-c/extern_2.c b/src/test/run-make/raw-dylib-c/extern_2.c
deleted file mode 100644
index ae87fc3f821..00000000000
--- a/src/test/run-make/raw-dylib-c/extern_2.c
+++ /dev/null
@@ -1,6 +0,0 @@
-#include <stdio.h>
-
-__declspec(dllexport) void extern_fn_3() {
-    printf("extern_fn_3\n");
-    fflush(stdout);
-}
diff --git a/src/test/run-make/raw-dylib-c/lib.rs b/src/test/run-make/raw-dylib-c/lib.rs
deleted file mode 100644
index 5fb1204037c..00000000000
--- a/src/test/run-make/raw-dylib-c/lib.rs
+++ /dev/null
@@ -1,37 +0,0 @@
-#![feature(raw_dylib)]
-
-#[link(name = "extern_1.dll", kind = "raw-dylib", modifiers = "+verbatim")]
-extern {
-    fn extern_fn_1();
-}
-
-#[link(name = "extern_2", kind = "raw-dylib")]
-extern {
-    fn extern_fn_3();
-}
-
-pub fn library_function() {
-    #[link(name = "extern_1", kind = "raw-dylib")]
-    extern {
-        fn extern_fn_2();
-        fn print_extern_variable();
-        static mut extern_variable: i32;
-        #[link_name = "extern_fn_4"]
-        fn extern_fn_4_renamed();
-    }
-
-    unsafe {
-        extern_fn_1();
-        extern_fn_2();
-        extern_fn_3();
-        extern_fn_4_renamed();
-        extern_variable = 42;
-        print_extern_variable();
-        extern_variable = -42;
-        print_extern_variable();
-    }
-}
-
-fn main() {
-    library_function();
-}
diff --git a/src/test/run-make/raw-dylib-c/output.txt b/src/test/run-make/raw-dylib-c/output.txt
deleted file mode 100644
index cc970cef7bc..00000000000
--- a/src/test/run-make/raw-dylib-c/output.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-extern_fn_1
-extern_fn_2; didn't get the rename
-extern_fn_3
-extern_fn_4
-extern_variable value: 42
-extern_variable value: -42