Endilll wrote:

> So, there is no way to consistently check on all platforms that we didn't 
> crash when an error diagnostic was issued (does clang return non-zero when 
> there is error diagnostic?), is that a right understanding?

Yes. On Linux and Windows `1` is returned if error diagnostic was issued.

> Still, if the tests won't be "pretty" that is not an excuse to not add tests, 
> IMO.

I tried my best to explain that it's not an issues of prettiness. Complicated 
solution that _seems_ to be possible to craft today feels too brittle, 
requiring reader to understand how various parts are fit together, not to say 
I'm not sure myself if something won't slip between piping behavior, `not`, 
`not --crash`, `FileCheck`, and varied platforms.

If you can point me to existing corpus of crash tests that are done correctly, 
I'll be happy to follow. So far I saw handful of crash tests here and there 
across out test suite of various quality: from tests that do not account for 
segmentation faults 
(https://github.com/llvm/llvm-project/blob/88d1de5ec64210686d93a90529583505635d257d/clang/test/Parser/objc-diag-width.mm
 is going to fire in this case even though it's not intended to) to borderline 
useless tests 
(https://github.com/llvm/llvm-project/blob/60963272c5c83890910fd97f8d941180b6006fca/clang/test/Sema/crash-deduction-guide-access.cpp
 is going to pass if clang crashes or error diagnostic is produced, because in 
both cases exit code is not zero).

https://github.com/llvm/llvm-project/pull/78898
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to