Skip to content

Commit eb308a6

Browse files
committed
---
yaml --- r: 130845 b: refs/heads/auto c: e7a000e h: refs/heads/master i: 130843: 42e8ac5 v: v3
1 parent d620794 commit eb308a6

File tree

5 files changed

+46
-1
lines changed

5 files changed

+46
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 61414a985004a8948be8d01de11f4e55ef0dbad4
16+
refs/heads/auto: e7a000e717b06d7010c872efb1ed395fe8d8857d
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-include ../tools.mk
2+
3+
# Verifies that the -L arguments given to the linker is in the same order
4+
# as the -L arguments on the rustc command line.
5+
6+
CORRECT_DIR=$(TMPDIR)/correct
7+
WRONG_DIR=$(TMPDIR)/wrong
8+
9+
all: $(TMPDIR)/libcorrect.a $(TMPDIR)/libwrong.a
10+
mkdir -p $(CORRECT_DIR) $(WRONG_DIR)
11+
mv $(TMPDIR)/libcorrect.a $(CORRECT_DIR)/libfoo.a
12+
mv $(TMPDIR)/libwrong.a $(WRONG_DIR)/libfoo.a
13+
$(RUSTC) main.rs -o $(TMPDIR)/should_succeed -L $(CORRECT_DIR) -L $(WRONG_DIR)
14+
$(call RUN,should_succeed)
15+
$(RUSTC) main.rs -o $(TMPDIR)/should_fail -L $(WRONG_DIR) -L $(CORRECT_DIR)
16+
$(call FAIL,should_fail)
17+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int should_return_one() { return 1; }
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright 2014 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+
extern crate libc;
12+
13+
#[link(name="foo")]
14+
extern {
15+
fn should_return_one() -> libc::c_int;
16+
}
17+
18+
fn main() {
19+
let result = unsafe {
20+
should_return_one()
21+
};
22+
23+
if result != 1 {
24+
std::os::set_exit_status(255);
25+
}
26+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int should_return_one() { return 0; }

0 commit comments

Comments
 (0)