rollup merge of #18470 : alexcrichton/dash-l
This commit is contained in:
commit
6478fcfafe
16 changed files with 234 additions and 40 deletions
13
src/test/auxiliary/macro-include-items-expr.rs
Normal file
13
src/test/auxiliary/macro-include-items-expr.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
// ignore-test: this is not a test
|
||||
|
||||
1
|
||||
13
src/test/auxiliary/macro-include-items-item.rs
Normal file
13
src/test/auxiliary/macro-include-items-item.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
// ignore-test: this is not a test
|
||||
|
||||
fn foo() { bar() }
|
||||
17
src/test/compile-fail/manual-link-bad-form.rs
Normal file
17
src/test/compile-fail/manual-link-bad-form.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
// compile-flags:-l :static
|
||||
// error-pattern: empty library name given via `-l`
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
||||
|
||||
16
src/test/compile-fail/manual-link-bad-kind.rs
Normal file
16
src/test/compile-fail/manual-link-bad-kind.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
// compile-flags:-l foo:bar
|
||||
// error-pattern: unknown library kind `bar`, expected one of dylib, framework, or static
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
||||
17
src/test/compile-fail/manual-link-framework.rs
Normal file
17
src/test/compile-fail/manual-link-framework.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
// ignore-macos
|
||||
// ignore-ios
|
||||
// compile-flags:-l foo:framework
|
||||
// error-pattern: native frameworks are only available on OSX targets
|
||||
|
||||
fn main() {
|
||||
}
|
||||
7
src/test/run-make/manual-link/Makefile
Normal file
7
src/test/run-make/manual-link/Makefile
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
-include ../tools.mk
|
||||
|
||||
all: $(TMPDIR)/libbar.a
|
||||
$(RUSTC) foo.rs -lbar:static
|
||||
$(RUSTC) main.rs
|
||||
$(call RUN,main)
|
||||
|
||||
1
src/test/run-make/manual-link/bar.c
Normal file
1
src/test/run-make/manual-link/bar.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
void bar() {}
|
||||
1
src/test/run-make/manual-link/foo.c
Normal file
1
src/test/run-make/manual-link/foo.c
Normal file
|
|
@ -0,0 +1 @@
|
|||
void bar() {}
|
||||
19
src/test/run-make/manual-link/foo.rs
Normal file
19
src/test/run-make/manual-link/foo.rs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
#![crate_type = "rlib"]
|
||||
|
||||
extern {
|
||||
fn bar();
|
||||
}
|
||||
|
||||
pub fn foo() {
|
||||
unsafe { bar(); }
|
||||
}
|
||||
15
src/test/run-make/manual-link/main.rs
Normal file
15
src/test/run-make/manual-link/main.rs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
// Copyright 2014 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 crate foo;
|
||||
|
||||
fn main() {
|
||||
foo::foo();
|
||||
}
|
||||
18
src/test/run-pass/macro-include-items.rs
Normal file
18
src/test/run-pass/macro-include-items.rs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Copyright 2014 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.
|
||||
|
||||
fn bar() {}
|
||||
|
||||
include!(concat!("", "", "../auxiliary/", "macro-include-items-item.rs"))
|
||||
|
||||
fn main() {
|
||||
foo();
|
||||
assert_eq!(include!(concat!("", "../auxiliary/", "macro-include-items-expr.rs")), 1u);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue