From c36095857084e9c5043ff72adeb4ef7330102701 Mon Sep 17 00:00:00 2001 From: Weihang Lo Date: Fri, 29 Nov 2024 22:12:54 -0500 Subject: [PATCH] test(pgo): determine test runnability at compile time --- tests/testsuite/pgo.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/testsuite/pgo.rs b/tests/testsuite/pgo.rs index 631a80c9000..a2b369f8846 100644 --- a/tests/testsuite/pgo.rs +++ b/tests/testsuite/pgo.rs @@ -23,13 +23,10 @@ fn llvm_profdata() -> Option { } #[cargo_test] +// macOS may emit different LLVM PGO warnings. +// Windows LLVM has different requirements. +#[cfg_attr(not(target_os = "linux"), ignore = "linux only")] fn pgo_works() { - if cfg!(not(target_os = "linux")) { - // macOS may emit different LLVM PGO warnings. - // Windows LLVM has different requirements. - return; - } - let Some(llvm_profdata) = llvm_profdata() else { return; };