
`#[target_feature]` attributes refer to a target-specific list of features. Enabling certain features can imply enabling other features. Certain features are always enabled on certain targets, since they are required by the target's ABI. Features can also be enabled indirectly based on other compiler flags. Feature information is ultimately known to `rustc`. Rather than force external tools to track it -- which may be wildly impractical due to `-C target-cpu` -- have `rustdoc` output `rustc`'s feature data.
10 lines
453 B
XML
10 lines
453 B
XML
//@ only-x86_64
|
|
|
|
// If we enable AVX2, we should see that it is enabled
|
|
//@ compile-flags: -Ctarget-feature=+avx2
|
|
//@ is "$.target.target_features[?(@.name=='avx2')].globally_enabled" true
|
|
|
|
// As well as its dependency chain
|
|
//@ is "$.target.target_features[?(@.name=='avx')].globally_enabled" true
|
|
//@ is "$.target.target_features[?(@.name=='sse4.2')].globally_enabled" true
|
|
//@ is "$.target.target_features[?(@.name=='sse4.1')].globally_enabled" true
|