Build compiler-rt/builtins with MSVC
This commit is contained in:
parent
54d85b4f2f
commit
9fe4e962e1
5 changed files with 89 additions and 34 deletions
17
src/test/run-make/compiler-rt-works-on-mingw/Makefile
Normal file
17
src/test/run-make/compiler-rt-works-on-mingw/Makefile
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
-include ../tools.mk
|
||||
|
||||
ifneq (,$(findstring MINGW,$(UNAME)))
|
||||
ifndef IS_MSVC
|
||||
all:
|
||||
g++ foo.cpp -c -o $(TMPDIR)/foo.o
|
||||
ar crus $(TMPDIR)/libfoo.a $(TMPDIR)/foo.o
|
||||
$(RUSTC) foo.rs -lfoo -lstdc++
|
||||
$(call RUN,foo)
|
||||
else
|
||||
all:
|
||||
|
||||
endif
|
||||
else
|
||||
all:
|
||||
|
||||
endif
|
||||
5
src/test/run-make/compiler-rt-works-on-mingw/foo.cpp
Normal file
5
src/test/run-make/compiler-rt-works-on-mingw/foo.cpp
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// ignore-license
|
||||
extern "C" void foo() {
|
||||
int *a = new int(3);
|
||||
delete a;
|
||||
}
|
||||
16
src/test/run-make/compiler-rt-works-on-mingw/foo.rs
Normal file
16
src/test/run-make/compiler-rt-works-on-mingw/foo.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern { fn foo(); }
|
||||
|
||||
pub fn main() {
|
||||
unsafe { foo(); }
|
||||
assert_eq!(7f32.powi(3), 343f32);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue