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