Auto merge of #29478 - angelsl:msvc2, r=alexcrichton

r? @alexcrichton
This commit is contained in:
bors 2015-11-04 06:07:24 +00:00
commit cc403b6c33
6 changed files with 90 additions and 35 deletions

@ -1 +1 @@
Subproject commit 58ab642c30d9f97735d5745b5d01781ee199c6ae
Subproject commit 93d0384373750b52996fd7f8249adaae39f562d8

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