2018-01-05 15:26:26 -06:00
|
|
|
// ignore-arm
|
|
|
|
// ignore-aarch64
|
2018-01-08 15:43:42 -06:00
|
|
|
// ignore-wasm
|
|
|
|
// ignore-emscripten
|
2018-04-03 09:40:05 -05:00
|
|
|
// ignore-mips
|
2018-07-31 04:01:27 -05:00
|
|
|
// ignore-mips64
|
2018-04-10 03:19:58 -05:00
|
|
|
// ignore-powerpc
|
2018-06-05 17:12:00 -05:00
|
|
|
// ignore-powerpc64
|
|
|
|
// ignore-powerpc64le
|
2018-04-10 03:19:58 -05:00
|
|
|
// ignore-s390x
|
2018-06-04 06:27:32 -05:00
|
|
|
// ignore-sparc
|
|
|
|
// ignore-sparc64
|
2018-01-05 15:26:26 -06:00
|
|
|
|
|
|
|
#![feature(target_feature)]
|
|
|
|
|
|
|
|
#[target_feature = "+sse2"]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR malformed `target_feature` attribute
|
2018-01-05 15:26:26 -06:00
|
|
|
#[target_feature(enable = "foo")]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR not valid for this target
|
|
|
|
//~| NOTE `foo` is not valid for this target
|
2018-01-05 15:26:26 -06:00
|
|
|
#[target_feature(bar)]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR malformed `target_feature` attribute
|
2018-01-05 15:26:26 -06:00
|
|
|
#[target_feature(disable = "baz")]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR malformed `target_feature` attribute
|
2018-01-05 15:26:26 -06:00
|
|
|
unsafe fn foo() {}
|
|
|
|
|
|
|
|
#[target_feature(enable = "sse2")]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR #[target_feature(..)] can only be applied to `unsafe` functions
|
|
|
|
//~| NOTE can only be applied to `unsafe` functions
|
2018-01-05 15:26:26 -06:00
|
|
|
fn bar() {}
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ NOTE not an `unsafe` function
|
2018-01-05 15:26:26 -06:00
|
|
|
|
2018-03-05 10:12:13 -06:00
|
|
|
#[target_feature(enable = "sse2")]
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ ERROR attribute should be applied to a function
|
2018-03-05 10:12:13 -06:00
|
|
|
mod another {}
|
2019-05-21 19:47:23 -05:00
|
|
|
//~^ NOTE not a function
|
2018-03-05 10:12:13 -06:00
|
|
|
|
2018-03-27 13:42:04 -05:00
|
|
|
#[inline(always)]
|
|
|
|
//~^ ERROR: cannot use #[inline(always)]
|
|
|
|
#[target_feature(enable = "sse2")]
|
|
|
|
unsafe fn test() {}
|
|
|
|
|
2018-01-05 15:26:26 -06:00
|
|
|
fn main() {
|
|
|
|
unsafe {
|
|
|
|
foo();
|
|
|
|
bar();
|
|
|
|
}
|
|
|
|
}
|