diff --git a/crates/metal2vulkan-validation/src/air_writer/tests.rs b/crates/metal2vulkan-validation/src/air_writer/tests.rs index 55218700e..854f07f8f 100644 --- a/crates/metal2vulkan-validation/src/air_writer/tests.rs +++ b/crates/metal2vulkan-validation/src/air_writer/tests.rs @@ -739,13 +739,32 @@ fn a_source_above_the_compiler_s_metal_standard_is_skipped_and_counted() { assert!(tally.above[0].contains("a27_memory_order.metal")); } +/// An older `metal-opt` refuses the architecture of a newer AIR it does not know (the +/// MetalToolchain 17.6 of Xcode 26.6 on a fixture of target `air64_v29`): the input is skipped, +/// listed and counted, not failed. The input is a fixture whose own `target triple` names +/// `air64_v29`. +#[test] +fn an_input_of_an_architecture_the_toolchain_does_not_know_is_skipped_and_counted() { + let path = fixtures().join("engine").join("tns_mm_v2.air.ll"); + let refusal = "metal-opt: the input passes no level: /usr/metal/current/bin/metal-opt: \ + unrecognized architecture 'air64_v29' provided.\n"; + let mut tally = Tally::default(); + tally.refused(&path, refusal); + assert_eq!(tally.failures, Vec::::new()); + assert_eq!(tally.above.len(), 1, "{:?}", tally.above); + assert!(tally.above[0].contains("tns_mm_v2.air.ll")); + assert!(tally.above[0].contains("air64_v29")); +} + /// Every other toolchain error still fails: another metallib error; a version refusal whose /// expected version is not below the input's, or that names a version the input does not state; a /// compiler refusal of a standard the source does not name, or where the compiler offers the -/// source's; any other compiler error. +/// source's; any other compiler error; a refusal of an architecture the input's `target triple` +/// does not name, or of one where the input states no triple. #[test] fn every_other_toolchain_error_fails() { let air = fixtures().join("engine").join("air_2_9_front_end.air.ll"); + let air29 = fixtures().join("engine").join("tns_mm_v2.air.ll"); let msl = fixtures().join("engine").join("a27_memory_order.metal"); let errors = [ (&air, "metallib: error: undefined symbol '_air.foo'\n"), @@ -770,6 +789,14 @@ fn every_other_toolchain_error_fails() { note: use 'metal4.1' for 'Metal 4.1' standard\n", ), (&msl, "error: use of undeclared identifier 'foo'\n"), + ( + &air29, + "metal-opt: unrecognized architecture 'air64_v30' provided.\n", + ), + ( + &msl, + "metal-opt: unrecognized architecture 'air64_v29' provided.\n", + ), ]; for (path, error) in errors { let mut tally = Tally::default();