diff options
| author | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-06-25 09:47:48 +0200 |
|---|---|---|
| committer | Jonathan Brouwer <jonathantbrouwer@gmail.com> | 2025-07-03 07:54:19 +0200 |
| commit | 3d5d72b76105056af5886cbad4661a26f9409b8e (patch) | |
| tree | d6052fe37acd26146cbd4b060ca9b323089180bc /tests/rustdoc-json | |
| parent | 25face9808491588e59b6d7844f2185b09eef479 (diff) | |
| download | rust-3d5d72b76105056af5886cbad4661a26f9409b8e.tar.gz rust-3d5d72b76105056af5886cbad4661a26f9409b8e.zip | |
Port `#[target_feature]` to the new attribute parsing infrastructure
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
Diffstat (limited to 'tests/rustdoc-json')
| -rw-r--r-- | tests/rustdoc-json/attrs/target_feature.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/rustdoc-json/attrs/target_feature.rs b/tests/rustdoc-json/attrs/target_feature.rs new file mode 100644 index 00000000000..ee2b3235f72 --- /dev/null +++ b/tests/rustdoc-json/attrs/target_feature.rs @@ -0,0 +1,17 @@ +//@ only-x86_64 + +//@ is "$.index[?(@.name=='test1')].attrs" '["#[target_feature(enable=\"avx\")]"]' +#[target_feature(enable = "avx")] +pub fn test1() {} + +//@ is "$.index[?(@.name=='test2')].attrs" '["#[target_feature(enable=\"avx\", enable=\"avx2\")]"]' +#[target_feature(enable = "avx,avx2")] +pub fn test2() {} + +//@ is "$.index[?(@.name=='test3')].attrs" '["#[target_feature(enable=\"avx\", enable=\"avx2\")]"]' +#[target_feature(enable = "avx", enable = "avx2")] +pub fn test3() {} + +//@ is "$.index[?(@.name=='test4')].attrs" '["#[target_feature(enable=\"avx\", enable=\"avx2\", enable=\"avx512f\")]"]' +#[target_feature(enable = "avx", enable = "avx2,avx512f")] +pub fn test4() {} |
