2025-07-07 00:56:29 +00:00
|
|
|
//@ is "$.index[?(@.name=='test1')].inner.function.header.is_unsafe" false
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ count "$.index[?(@.name=='test1')].attrs[*]" 1
|
|
|
|
|
//@ is "$.index[?(@.name=='test1')].attrs[*].target_feature.enable" '["avx"]'
|
2025-06-25 09:47:48 +02:00
|
|
|
#[target_feature(enable = "avx")]
|
|
|
|
|
pub fn test1() {}
|
|
|
|
|
|
2025-07-11 02:27:39 +03:00
|
|
|
//@ is "$.index[?(@.name=='test2')].inner.function.header.is_unsafe" false
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ count "$.index[?(@.name=='test2')].attrs[*]" 1
|
|
|
|
|
//@ is "$.index[?(@.name=='test2')].attrs[*].target_feature.enable" '["avx", "avx2"]'
|
2025-06-25 09:47:48 +02:00
|
|
|
#[target_feature(enable = "avx,avx2")]
|
|
|
|
|
pub fn test2() {}
|
|
|
|
|
|
2025-07-11 02:27:39 +03:00
|
|
|
//@ is "$.index[?(@.name=='test3')].inner.function.header.is_unsafe" false
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ count "$.index[?(@.name=='test3')].attrs[*]" 1
|
|
|
|
|
//@ is "$.index[?(@.name=='test3')].attrs[*].target_feature.enable" '["avx", "avx2"]'
|
2025-06-25 09:47:48 +02:00
|
|
|
#[target_feature(enable = "avx", enable = "avx2")]
|
|
|
|
|
pub fn test3() {}
|
|
|
|
|
|
2025-07-11 02:27:39 +03:00
|
|
|
//@ is "$.index[?(@.name=='test4')].inner.function.header.is_unsafe" false
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ count "$.index[?(@.name=='test4')].attrs[*]" 1
|
|
|
|
|
//@ is "$.index[?(@.name=='test4')].attrs[*].target_feature.enable" '["avx", "avx2", "avx512f"]'
|
2025-06-25 09:47:48 +02:00
|
|
|
#[target_feature(enable = "avx", enable = "avx2,avx512f")]
|
|
|
|
|
pub fn test4() {}
|
2025-07-07 00:56:29 +00:00
|
|
|
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ count "$.index[?(@.name=='test5')].attrs[*]" 1
|
|
|
|
|
//@ is "$.index[?(@.name=='test5')].attrs[*].target_feature.enable" '["avx", "avx2"]'
|
|
|
|
|
#[target_feature(enable = "avx")]
|
|
|
|
|
#[target_feature(enable = "avx2")]
|
|
|
|
|
pub fn test5() {}
|
|
|
|
|
|
2025-07-07 00:56:29 +00:00
|
|
|
//@ is "$.index[?(@.name=='test_unsafe_fn')].inner.function.header.is_unsafe" true
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ count "$.index[?(@.name=='test_unsafe_fn')].attrs[*]" 1
|
|
|
|
|
//@ is "$.index[?(@.name=='test_unsafe_fn')].attrs[*].target_feature.enable" '["avx"]'
|
2025-07-07 00:56:29 +00:00
|
|
|
#[target_feature(enable = "avx")]
|
|
|
|
|
pub unsafe fn test_unsafe_fn() {}
|
|
|
|
|
|
|
|
|
|
pub struct Example;
|
|
|
|
|
|
|
|
|
|
impl Example {
|
|
|
|
|
//@ is "$.index[?(@.name=='safe_assoc_fn')].inner.function.header.is_unsafe" false
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ is "$.index[?(@.name=='safe_assoc_fn')].attrs[*].target_feature.enable" '["avx"]'
|
2025-07-07 00:56:29 +00:00
|
|
|
#[target_feature(enable = "avx")]
|
|
|
|
|
pub fn safe_assoc_fn() {}
|
|
|
|
|
|
|
|
|
|
//@ is "$.index[?(@.name=='unsafe_assoc_fn')].inner.function.header.is_unsafe" true
|
2025-06-20 02:48:15 +00:00
|
|
|
//@ is "$.index[?(@.name=='unsafe_assoc_fn')].attrs[*].target_feature.enable" '["avx"]'
|
2025-07-07 00:56:29 +00:00
|
|
|
#[target_feature(enable = "avx")]
|
|
|
|
|
pub unsafe fn unsafe_assoc_fn() {}
|
|
|
|
|
}
|