mirror of https://github.com/rust-lang/rust.git
add test for wasm linker override=clang
This commit is contained in:
parent
085acd02d4
commit
4fa4758fe2
|
@ -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
|
|
@ -0,0 +1,6 @@
|
|||
#![crate_type = "cdylib"]
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn add(a: i32, b: i32) -> i32 {
|
||||
a + b
|
||||
}
|
Loading…
Reference in New Issue