From fbce5e0eeb3e3011d48d11f096b31259f1afbd6c Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Sat, 31 Oct 2026 06:01:05 +0200 Subject: [PATCH] Expect the command line to compile a kernel whose constant is undefined llvm_text_is_assembled_by_llvm_as still expected the command line to ask for the kernel's function constant (exit 2, a --constant hint). Since undefined constants compile as Metal's do, the kernel compiles without the value; the test now checks that it writes its module, then compiles it again with the value. The test skips its llvm-as half when llvm-as is not on PATH, which is why the lane's suite runs passed it; development's post-merge checks, with Homebrew's LLVM on PATH, failed it. Verified: cargo nextest run -p metal2vulkan --all-features -E 'binary(cli)' with /opt/homebrew/opt/llvm/bin on PATH, 8/8, the llvm-as half running. --- crates/metal2vulkan/tests/cli.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/metal2vulkan/tests/cli.rs b/crates/metal2vulkan/tests/cli.rs index 3039214e8..b1c250595 100644 --- a/crates/metal2vulkan/tests/cli.rs +++ b/crates/metal2vulkan/tests/cli.rs @@ -385,11 +385,12 @@ fn llvm_text_is_assembled_by_llvm_as() { eprintln!("SKIPPED: llvm-as not on PATH and METAL2VULKAN_LLVM_AS unset"); return; }; - // The kernel reads a function constant: compiling asks for it, and its value compiles. + // The kernel reads a function constant: it compiles with the constant undefined, as Metal's + // does, and with its value. let result = cli(&scratch, &args, &[("METAL2VULKAN_LLVM_AS", &llvm_as)]); - let stderr = text(&result.stderr); - assert_eq!(result.status.code(), Some(2), "{stderr}"); - assert!(stderr.contains("--constant 0:TYPE:VALUE"), "{stderr}"); + assert!(result.status.success(), "{}", text(&result.stderr)); + assert!(output.exists()); + std::fs::remove_file(&output).unwrap(); let mut supplied = args.to_vec(); supplied.extend([os("--constant"), os("0:uint4:1,2,3,4")]); let result = cli(&scratch, &supplied, &[("METAL2VULKAN_LLVM_AS", &llvm_as)]);