Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/test/run-make/raw-dylib-alt-calling-convention/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Test the behavior of #[link(.., kind = "raw-dylib")] with alternative calling conventions.

# only-i686-pc-windows-msvc
# only-x86
# only-windows

-include ../../run-make-fulldeps/tools.mk

all:
$(call COMPILE_OBJ,"$(TMPDIR)"/extern.obj,extern.c)
ifdef IS_MSVC
$(CC) "$(TMPDIR)"/extern.obj -link -dll -out:"$(TMPDIR)"/extern.dll
else
$(CC) "$(TMPDIR)"/extern.obj -shared -o "$(TMPDIR)"/extern.dll
endif
$(RUSTC) --crate-type lib --crate-name raw_dylib_alt_calling_convention_test lib.rs
$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
Expand Down
7 changes: 5 additions & 2 deletions src/test/run-make/raw-dylib-alt-calling-convention/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,12 @@ pub fn library_function() {
fastcall_fn_2(16, 3.5);
fastcall_fn_3(3.5);
fastcall_fn_4(1, 2, 3.0);
fastcall_fn_5(S { x: 1, y: 2 }, 16);
// FIXME: 91167
// rustc generates incorrect code for the calls to fastcall_fn_5 and fastcall_fn_7
// on i686-pc-windows-gnu; commenting these out until the indicated issue is fixed.
//fastcall_fn_5(S { x: 1, y: 2 }, 16);
fastcall_fn_6(Some(&S { x: 10, y: 12 }));
fastcall_fn_7(S2 { x: 15, y: 16 }, 3);
//fastcall_fn_7(S2 { x: 15, y: 16 }, 3);
fastcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] });
fastcall_fn_9(1, 3.0);
}
Expand Down
2 changes: 0 additions & 2 deletions src/test/run-make/raw-dylib-alt-calling-convention/output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ fastcall_fn_1(14)
fastcall_fn_2(16, 3.5)
fastcall_fn_3(3.5)
fastcall_fn_4(1, 2, 3.0)
fastcall_fn_5(S { x: 1, y: 2 }, 16)
fastcall_fn_6(S { x: 10, y: 12 })
fastcall_fn_7(S2 { x: 15, y: 16 }, 3)
fastcall_fn_8(S3 { x: [1, 2, 3, 4, 5] }, S3 { x: [6, 7, 8, 9, 10] })
fastcall_fn_9(1, 3.0)