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.
This commit is contained in:
1 parent
9c80a4957b
commit
fbce5e0eeb
1 file changed
+5
-4
@@ -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)]);
|
||||
|
||||
Reference in new issue
Block a user