Skip to content

Commit 1b35d5f

Browse files
committed
tests: Add a regression test for crt-static with target features
Signed-off-by: Jens Reidel <[email protected]>
1 parent 664d742 commit 1b35d5f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Test to ensure that specifying a value for crt-static in target features
2+
// does not result in skipping the features following it.
3+
// This is a regression test for #144143
4+
5+
//@ add-core-stubs
6+
//@ needs-llvm-components: x86
7+
//@ compile-flags: --target=x86_64-unknown-linux-gnu
8+
//@ compile-flags: -Ctarget-feature=+crt-static,+avx2
9+
10+
#![crate_type = "rlib"]
11+
#![feature(no_core, rustc_attrs, lang_items)]
12+
#![no_core]
13+
14+
extern crate minicore;
15+
use minicore::*;
16+
17+
#[rustc_builtin_macro]
18+
macro_rules! compile_error {
19+
() => {};
20+
}
21+
22+
#[cfg(target_feature = "avx2")]
23+
compile_error!("+avx2");
24+
//~^ ERROR: +avx2
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: +avx2
2+
--> $DIR/crt-static-with-target-features-works.rs:23:1
3+
|
4+
LL | compile_error!("+avx2");
5+
| ^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)