From 4fa4758fe2a2ae347b7d7d4cce19a6762f658e8c Mon Sep 17 00:00:00 2001 From: reez12g Date: Fri, 29 Sep 2023 23:01:32 +0900 Subject: [PATCH] add test for wasm linker override=clang --- tests/run-make/wasm-override-linker/Makefile | 13 +++++++++++++ tests/run-make/wasm-override-linker/foo.rs | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 tests/run-make/wasm-override-linker/Makefile create mode 100644 tests/run-make/wasm-override-linker/foo.rs diff --git a/tests/run-make/wasm-override-linker/Makefile b/tests/run-make/wasm-override-linker/Makefile new file mode 100644 index 00000000000..52339f9261c --- /dev/null +++ b/tests/run-make/wasm-override-linker/Makefile @@ -0,0 +1,13 @@ +# needs-matching-clang + +include ../tools.mk + +ifeq ($(TARGET),wasm32-unknown-unknown) +all: + $(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG) +else ifeq ($(TARGET),wasm64-unknown-unknown) +all: + $(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG) +else +all: +endif diff --git a/tests/run-make/wasm-override-linker/foo.rs b/tests/run-make/wasm-override-linker/foo.rs new file mode 100644 index 00000000000..f4167a4fc4a --- /dev/null +++ b/tests/run-make/wasm-override-linker/foo.rs @@ -0,0 +1,6 @@ +#![crate_type = "cdylib"] + +#[no_mangle] +pub extern "C" fn add(a: i32, b: i32) -> i32 { + a + b +}