test for immediate symbol name hashing

This commit is contained in:
Niko Matsakis 2016-03-24 13:20:08 -04:00
parent 87debd9328
commit ab0a87243e
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,7 @@
-include ../tools.mk
all:
$(RUSTC) a.rs --cfg x -C prefer-dynamic
$(RUSTC) b.rs -C prefer-dynamic
$(RUSTC) a.rs --cfg y -C prefer-dynamic
$(call RUN,b) 2>&1 | grep "undefined symbol"

View File

@ -0,0 +1,10 @@
#![crate_name = "a"]
#![crate_type = "dylib"]
#[cfg(x)]
pub fn foo(x: u32) { }
#[cfg(y)]
pub fn foo(x: i32) { }

View File

@ -0,0 +1,7 @@
#![crate_name = "b"]
extern crate a;
fn main() {
a::foo(22_u32);
}