basic tests for cross-crate hashing
This commit is contained in:
parent
3a2edd7e61
commit
bed7ea8609
@ -0,0 +1,24 @@
|
||||
// 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"]
|
||||
|
||||
#[cfg(rpass1)]
|
||||
pub fn function0(x: u32) -> u32 {
|
||||
x
|
||||
}
|
||||
|
||||
#[cfg(rpass2)]
|
||||
pub fn function0(x: i32) -> i32 {
|
||||
x
|
||||
}
|
||||
|
||||
pub fn function1(x: u32) {
|
||||
}
|
28
src/test/incremental/callee_caller_cross_crate/b.rs
Normal file
28
src/test/incremental/callee_caller_cross_crate/b.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// 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.
|
||||
|
||||
// aux-build:a.rs
|
||||
// revisions:rpass1 rpass2
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
extern crate a;
|
||||
|
||||
#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
|
||||
pub fn call_function0() {
|
||||
a::function0(77);
|
||||
}
|
||||
|
||||
#[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
|
||||
pub fn call_function1() {
|
||||
a::function1(77);
|
||||
}
|
||||
|
||||
pub fn main() { }
|
21
src/test/incremental/type_alias_cross_crate/auxiliary/a.rs
Normal file
21
src/test/incremental/type_alias_cross_crate/auxiliary/a.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// 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"]
|
||||
|
||||
#[cfg(rpass1)]
|
||||
pub type X = u32;
|
||||
|
||||
#[cfg(rpass2)]
|
||||
pub type X = i32;
|
||||
|
||||
pub type Y = char;
|
||||
|
||||
pub fn foo() { }
|
29
src/test/incremental/type_alias_cross_crate/b.rs
Normal file
29
src/test/incremental/type_alias_cross_crate/b.rs
Normal file
@ -0,0 +1,29 @@
|
||||
// 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.
|
||||
|
||||
// aux-build:a.rs
|
||||
// revisions:rpass1 rpass2
|
||||
|
||||
#![feature(rustc_attrs)]
|
||||
|
||||
extern crate a;
|
||||
|
||||
#[rustc_dirty(label="TypeckItemBody", cfg="rpass2")]
|
||||
pub fn use_X() -> u32 {
|
||||
let x: a::X = 22;
|
||||
x as u32
|
||||
}
|
||||
|
||||
#[rustc_clean(label="TypeckItemBody", cfg="rpass2")]
|
||||
pub fn use_Y() {
|
||||
let x: a::Y = 'c';
|
||||
}
|
||||
|
||||
pub fn main() { }
|
Loading…
x
Reference in New Issue
Block a user