rust/src/test/run-pass/phase-syntax-link-does-resolve.rs
Alex Crichton bd469341eb test: Add the ability to force a host target
The new macro loading infrastructure needs the ability to force a
procedural-macro crate to be built with the host architecture rather than the
target architecture (because the compiler is just about to dlopen it).
2014-01-17 11:13:22 -08:00

36 lines
1.2 KiB
Rust

// Copyright 2013 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:macro_crate_test.rs
// xfail-stage1
// xfail-fast
// xfail-android
// force-host
// You'll note that there's lots of directives above. This is a very particular
// test in which we're both linking to a macro crate and loading macros from it.
// This implies that both versions are the host architecture, meaning this test
// must also be compiled with the host arch.
//
// Hence, xfail-stage1 because macros are unstable around there, xfail-fast
// because this doesn't work with that test runner, xfail-android because it
// can't run host binaries, and force-host to make this test build as the host
// arch.
#[feature(phase)];
#[phase(syntax, link)]
extern mod macro_crate_test;
fn main() {
assert_eq!(1, make_a_1!());
macro_crate_test::foo();
}