Skip to content

Commit 58f1b9c

Browse files
committed
Get tests working on MSVC 32-bit
1 parent 3e9589c commit 58f1b9c

File tree

15 files changed

+105
-102
lines changed

15 files changed

+105
-102
lines changed

mk/tests.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,8 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10291029
export INCLUDE := $$(CFG_MSVC_INCLUDE_PATH_$$(HOST_$(3)))
10301030
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10311031
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(3)))
1032+
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
1033+
export MSVC_LIB := "$$(CFG_MSVC_LIB_$$(HOST_$(3)))"
10321034
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10331035
$(S)src/test/run-make/%/Makefile \
10341036
$$(CSREQ$(1)_T_$(2)_H_$(3))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub extern fn f() -> i32 { 1 }
12+
pub extern fn g() -> i32 { 2 }
13+
14+
pub fn get_f() -> extern fn() -> i32 { f }
15+
pub fn get_g() -> extern fn() -> i32 { g }

src/test/auxiliary/fn-abi.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[no_mangle]
12+
pub extern fn foo() {}

src/test/run-fail/mir_trans_calls_converging_drops.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
1011
#![feature(rustc_attrs)]
12+
13+
// ignore-msvc: FIXME(#30941)
1114
// error-pattern:converging_fn called
1215
// error-pattern:0 dropped
1316
// error-pattern:exit

src/test/run-fail/mir_trans_calls_converging_drops_2.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
1011
#![feature(rustc_attrs)]
12+
13+
// ignore-msvc: FIXME(#30941)
1114
// error-pattern:complex called
1215
// error-pattern:dropped
1316
// error-pattern:exit

src/test/run-fail/mir_trans_calls_diverging_drops.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,13 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10+
1011
#![feature(rustc_attrs)]
12+
13+
// ignore-msvc: FIXME(#30941)
1114
// error-pattern:diverging_fn called
1215
// error-pattern:0 dropped
16+
1317
use std::io::{self, Write};
1418

1519
struct Droppable(u8);

src/test/run-make/execution-engine/test.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ use syntax::diagnostics::registry::Registry;
4242
use syntax::parse::token;
4343

4444
fn main() {
45+
// Currently trips an assertion on i686-msvc, presumably because the support
46+
// in LLVM is a little young.
47+
if cfg!(target_env = "msvc") && cfg!(target_arch = "x86") {
48+
return
49+
}
50+
4551
let program = r#"
4652
#[no_mangle]
4753
pub static TEST_STATIC: i32 = 42;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
-include ../tools.mk
22

3-
all: $(call NATIVE_STATICLIB,test)
3+
all: $(call NATIVE_STATICLIB,ctest)
44
$(RUSTC) testcrate.rs
55
$(RUSTC) test.rs
66
$(call RUN,test) || exit 1

src/test/run-make/extern-fn-with-union/testcrate.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010

1111
#![crate_type = "lib"]
1212

13+
#[repr(C)]
1314
pub struct TestUnion {
14-
val: u64
15+
_val: u64
1516
}
1617

17-
#[link(name = "test", kind = "static")]
18+
#[link(name = "ctest", kind = "static")]
1819
extern {
1920
pub fn give_back(tu: TestUnion) -> u64;
2021
}

0 commit comments

Comments
 (0)