Skip to content

Commit 138ad7b

Browse files
committed
---
yaml --- r: 131007 b: refs/heads/try c: e7a000e h: refs/heads/master i: 131005: f01a87d 131003: 985f1c2 130999: 8e96ad5 130991: c4cc36c 130975: 442e229 130943: 181bf2a v: v3
1 parent fd7f04c commit 138ad7b

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
@@ -2,7 +2,7 @@
22
refs/heads/master: 9c68679f2ebd5b165694e9346e4ad96a3e32aceb
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6faa4f33a42de32579e02a8d030db920d360e2b5
5-
refs/heads/try: 61414a985004a8948be8d01de11f4e55ef0dbad4
5+
refs/heads/try: e7a000e717b06d7010c872efb1ed395fe8d8857d
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
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)