Skip to content

Commit

Permalink
add test for wasm linker override=clang
Browse files Browse the repository at this point in the history
  • Loading branch information
reez12g committed Oct 8, 2023
1 parent 085acd0 commit b9f92a8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/run-make/wasm-override-linker/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
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
6 changes: 6 additions & 0 deletions tests/run-make/wasm-override-linker/foo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#![crate_type = "cdylib"]

#[no_mangle]
pub extern "C" fn add(a: i32, b: i32) -> i32 {
a + b
}

0 comments on commit b9f92a8

Please sign in to comment.