diff options
| author | bors <bors@rust-lang.org> | 2015-07-28 12:53:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-28 12:53:28 +0000 |
| commit | ec49d01c88b2098fd6fa550dbd23667fa6d98f50 (patch) | |
| tree | d39eb9d05542a55de80b97f736fd04c2d7f8b168 /src | |
| parent | 4c371bb6de7a1c21b7403b86a66a8ce3318ff003 (diff) | |
| parent | f01119c2219d7267045bc6464f3ea302a5257840 (diff) | |
| download | rust-ec49d01c88b2098fd6fa550dbd23667fa6d98f50.tar.gz rust-ec49d01c88b2098fd6fa550dbd23667fa6d98f50.zip | |
Auto merge of #27330 - alexcrichton:reenable-lto-syntax-extension, r=huonw
The functionality this was testing was removed somewhere along the line, and this commit restores what it was testing. Closes #20586
Diffstat (limited to 'src')
| -rw-r--r-- | src/test/auxiliary/lto-syntax-extension-lib.rs (renamed from src/test/run-make/lto-syntax-extension/lib.rs) | 6 | ||||
| -rw-r--r-- | src/test/auxiliary/lto-syntax-extension-plugin.rs (renamed from src/test/run-make/lto-syntax-extension/main.rs) | 13 | ||||
| -rw-r--r-- | src/test/run-make/lto-syntax-extension/Makefile | 18 | ||||
| -rw-r--r-- | src/test/run-pass-fulldeps/lto-syntax-extension.rs | 24 |
4 files changed, 38 insertions, 23 deletions
diff --git a/src/test/run-make/lto-syntax-extension/lib.rs b/src/test/auxiliary/lto-syntax-extension-lib.rs index 04d3ae67207..78c03bac33f 100644 --- a/src/test/run-make/lto-syntax-extension/lib.rs +++ b/src/test/auxiliary/lto-syntax-extension-lib.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,4 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// no-prefer-dynamic + #![crate_type = "rlib"] + +pub fn foo() {} diff --git a/src/test/run-make/lto-syntax-extension/main.rs b/src/test/auxiliary/lto-syntax-extension-plugin.rs index c9395f557fd..c3778326a4d 100644 --- a/src/test/run-make/lto-syntax-extension/main.rs +++ b/src/test/auxiliary/lto-syntax-extension-plugin.rs @@ -1,4 +1,4 @@ -// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,9 +8,14 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// force-host + +#![feature(plugin_registrar)] #![feature(rustc_private)] -extern crate lib; -#[macro_use] extern crate log; +extern crate rustc; + +use rustc::plugin::Registry; -fn main() {} +#[plugin_registrar] +pub fn plugin_registrar(_reg: &mut Registry) {} diff --git a/src/test/run-make/lto-syntax-extension/Makefile b/src/test/run-make/lto-syntax-extension/Makefile deleted file mode 100644 index 5f2b7a701a7..00000000000 --- a/src/test/run-make/lto-syntax-extension/Makefile +++ /dev/null @@ -1,18 +0,0 @@ --include ../tools.mk - -# This test attempts to use syntax extensions, which are known to be -# incompatible with stage1 at the moment. - -ifeq ($(RUST_BUILD_STAGE),1) -DOTEST= -else -DOTEST=dotest -endif - -all: $(DOTEST) - -dotest: - env - $(RUSTC) lib.rs - $(RUSTC) main.rs -C lto - $(call RUN,main) diff --git a/src/test/run-pass-fulldeps/lto-syntax-extension.rs b/src/test/run-pass-fulldeps/lto-syntax-extension.rs new file mode 100644 index 00000000000..e32f0852ad7 --- /dev/null +++ b/src/test/run-pass-fulldeps/lto-syntax-extension.rs @@ -0,0 +1,24 @@ +// 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. + +// aux-build:lto-syntax-extension-lib.rs +// aux-build:lto-syntax-extension-plugin.rs +// compile-flags:-C lto +// ignore-stage1 +// no-prefer-dynamic + +#![feature(plugin)] +#![plugin(lto_syntax_extension_plugin)] + +extern crate lto_syntax_extension_lib; + +fn main() { + lto_syntax_extension_lib::foo(); +} |
