2020-10-22 13:55:19 +02:00
|
|
|
// Tests #73631: closures inherit `#[target_feature]` annotations
|
|
|
|
|
|
|
|
|
|
//@ check-pass
|
|
|
|
|
//@ only-x86_64
|
|
|
|
|
|
2023-10-26 16:13:20 +00:00
|
|
|
#[target_feature(enable = "avx")]
|
2020-10-22 13:55:19 +02:00
|
|
|
fn also_use_avx() {
|
|
|
|
|
println!("Hello from AVX")
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-26 16:13:20 +00:00
|
|
|
#[target_feature(enable = "avx")]
|
2020-10-22 13:55:19 +02:00
|
|
|
fn use_avx() -> Box<dyn Fn()> {
|
|
|
|
|
Box::new(|| also_use_avx())
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-22 14:37:42 +02:00
|
|
|
fn main() {}
|