diff options
| author | Daniel Paoliello <danpao@microsoft.com> | 2022-09-12 14:03:19 -0700 |
|---|---|---|
| committer | Daniel Paoliello <danpao@microsoft.com> | 2022-09-12 14:03:19 -0700 |
| commit | 3c184db386ee3e1c4a9ae1b46836d29d657d5f43 (patch) | |
| tree | dcf62922b62cc3472ba5cde9b0512b5bf0b67792 /src/test/run-make/raw-dylib-c | |
| parent | 7f115e3cd239af753aeb398a114fa321a3ce584b (diff) | |
| download | rust-3c184db386ee3e1c4a9ae1b46836d29d657d5f43.tar.gz rust-3c184db386ee3e1c4a9ae1b46836d29d657d5f43.zip | |
Fix raw-dylib with link_name
Diffstat (limited to 'src/test/run-make/raw-dylib-c')
| -rw-r--r-- | src/test/run-make/raw-dylib-c/extern_1.c | 5 | ||||
| -rw-r--r-- | src/test/run-make/raw-dylib-c/lib.rs | 3 | ||||
| -rw-r--r-- | src/test/run-make/raw-dylib-c/output.txt | 1 |
3 files changed, 9 insertions, 0 deletions
diff --git a/src/test/run-make/raw-dylib-c/extern_1.c b/src/test/run-make/raw-dylib-c/extern_1.c index ab1dc3a4105..5d695547d0f 100644 --- a/src/test/run-make/raw-dylib-c/extern_1.c +++ b/src/test/run-make/raw-dylib-c/extern_1.c @@ -21,3 +21,8 @@ __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/lib.rs b/src/test/run-make/raw-dylib-c/lib.rs index 74e0d3813d9..005ffcdda5c 100644 --- a/src/test/run-make/raw-dylib-c/lib.rs +++ b/src/test/run-make/raw-dylib-c/lib.rs @@ -16,12 +16,15 @@ pub fn library_function() { 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; diff --git a/src/test/run-make/raw-dylib-c/output.txt b/src/test/run-make/raw-dylib-c/output.txt index cd9fe47bee4..cc970cef7bc 100644 --- a/src/test/run-make/raw-dylib-c/output.txt +++ b/src/test/run-make/raw-dylib-c/output.txt @@ -1,5 +1,6 @@ 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 |
