test that a no_builtins crate is passed to the linker
This commit is contained in:
parent
35eba85c3d
commit
e996405696
9
src/test/run-make/no-builtins-lto/Makefile
Normal file
9
src/test/run-make/no-builtins-lto/Makefile
Normal file
@ -0,0 +1,9 @@
|
||||
-include ../tools.mk
|
||||
|
||||
all:
|
||||
# Compile a `#![no_builtins]` rlib crate
|
||||
$(RUSTC) no_builtins.rs
|
||||
# Build an executable that depends on that crate using LTO. The no_builtins crate doesn't
|
||||
# participate in LTO, so its rlib must be explicitly linked into the final binary. Verify this by
|
||||
# grepping the linker arguments.
|
||||
$(RUSTC) main.rs -C lto -Z print-link-args | grep 'libno_builtins.rlib'
|
13
src/test/run-make/no-builtins-lto/main.rs
Normal file
13
src/test/run-make/no-builtins-lto/main.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// Copyright 2016 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 no_builtins;
|
||||
|
||||
fn main() {}
|
12
src/test/run-make/no-builtins-lto/no_builtins.rs
Normal file
12
src/test/run-make/no-builtins-lto/no_builtins.rs
Normal file
@ -0,0 +1,12 @@
|
||||
// Copyright 2016 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 = "lib"]
|
||||
#![no_builtins]
|
Loading…
Reference in New Issue
Block a user