Build compiler-rt/builtins with MSVC

This commit is contained in:
angelsl 2015-10-24 00:31:12 +08:00
parent 54d85b4f2f
commit 9fe4e962e1
5 changed files with 89 additions and 34 deletions

View 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

View file

@ -0,0 +1,5 @@
// ignore-license
extern "C" void foo() {
int *a = new int(3);
delete a;
}

View 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);
}