Skip to content

Commit 6ab097b

Browse files
committed
move platform headers into SupportedArchitectureTest
1 parent d70ef4f commit 6ab097b

File tree

2 files changed

+5
-2
lines changed
  • library/stdarch/crates/intrinsic-test/src

2 files changed

+5
-2
lines changed

library/stdarch/crates/intrinsic-test/src/arm/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
6565
}
6666
}
6767

68+
const PLATFORM_HEADERS: &[&str] = &["arm_neon.h", "arm_acle.h", "arm_fp16.h"];
69+
6870
fn build_c_file(&self) -> bool {
6971
let c_target = "aarch64";
70-
let platform_headers = &["arm_neon.h", "arm_acle.h", "arm_fp16.h"];
7172

7273
let (chunk_size, chunk_count) = chunk_info(self.intrinsics.len());
7374

@@ -81,7 +82,7 @@ impl SupportedArchitectureTest for ArmArchitectureTest {
8182
.map(|(i, chunk)| {
8283
let c_filename = format!("c_programs/mod_{i}.cpp");
8384
let mut file = File::create(&c_filename).unwrap();
84-
write_mod_cpp(&mut file, notice, c_target, platform_headers, chunk).unwrap();
85+
write_mod_cpp(&mut file, notice, c_target, Self::PLATFORM_HEADERS, chunk).unwrap();
8586

8687
// compile this cpp file into a .o file.
8788
//

library/stdarch/crates/intrinsic-test/src/common/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ pub trait SupportedArchitectureTest {
2424

2525
fn create(cli_options: ProcessedCli) -> Self;
2626

27+
const PLATFORM_HEADERS: &[&str];
28+
2729
fn build_c_file(&self) -> bool;
2830
fn build_rust_file(&self) -> bool;
2931

0 commit comments

Comments
 (0)