atrosinenko wrote:

Thinking a bit more about the tests, what if instead of these lots of new 
`RUN:` lines simply add "ptrauth-elf-got" flags (set to 0) to the very same set 
of test files? This would actually reflect the **real LLVM IR** that the 
updated frontend generates. Technically, this would not prevent some bugs in 
the future to break the ability of a "new" backend to handle legacy LLVM IR, 
but this hypothetical bug would hopefully result in an obvious error (unless 
someone would add a check like "consider ptrauth-elf-got to be in effect, 
unless there is a flag set to 0"). On the other hand, merely setting 
`ptrauth-elf-got` to 0 here and there would still catch the case I'm concerned 
about the most: "what if right now some code only tests for the module flag 
_presence_, but not its _value_, relying on the existing 1-or-absent behavior 
of the frontend".

To keep test coverage reasonable while drastically reducing the complexity of 
this patch and the updated tests, we could 1) add a couple lines to each of the 
affected test source (adding the flag explicitly set to 0, as per new frontend 
behavior) **and** 2) manually identify places where `ptrauth-elf-got` module 
flag is "parsed" and converted to boolean property, then write a short test 
covering these "entry points". This new test would probably use the 
`split-file` technique, but that would be a **single** file which is much 
**shorter** that the files currently affected.

https://github.com/llvm/llvm-project/pull/204226
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to