Skip to content

Commit

Permalink
Rollup merge of #93087 - ricobbe:alt-calling-convention-test-fix, r=M…
Browse files Browse the repository at this point in the history
…ark-Simulacrum

Fix src/test/run-make/raw-dylib-alt-calling-convention

Fix the test headers so that the test now runs on all intended platforms; it is currently ignored on all platforms because the headers are incorrect.  Also comment out a couple of function calls that fail because of an unrelated problem, described in issue #91167.
  • Loading branch information
matthiaskrgr committed Jan 20, 2022
2 parents 0a9aaec + 10858d2 commit 894a867
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
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)

0 comments on commit 894a867

Please sign in to comment.