CHECKs are always passing as FileCheck is actually matching part of test directory path instead of test output.
For example:
// CHECK-NEXT: header_stat_before_open.m
would pass with
/tmp/build/tools/clang/test/ClangScanDeps/Output/header_stat_before_open.m.tmp.dir/WHATEVER_FOO
Shoutout to @JDevlieghere who solved the puzzle why a CHECK is insensitive to test output!
I just added suffix "_input" to all test inputs to keep it simple and consistent. Happy to go with a different convention - open to suggestions as usually.
Honestly, I think it's very easy to shoot ourselves in the foot this way :( It might be worth writing a script that verifies that CHECKs don't contain test filename and run it in CI.