[all-commits] [llvm/llvm-project] 0f1fb6: [KnownBitsTest] Align with ConstantRange test infr...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon May 15 07:49:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f1fb626b3314386d3885f328cae36b830a04901
      https://github.com/llvm/llvm-project/commit/0f1fb626b3314386d3885f328cae36b830a04901
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-05-15 (Mon, 15 May 2023)

  Changed paths:
    M llvm/include/llvm/Support/KnownBits.h
    M llvm/lib/Support/KnownBits.cpp
    M llvm/unittests/Support/KnownBitsTest.cpp

  Log Message:
  -----------
  [KnownBitsTest] Align with ConstantRange test infrastructure (NFC)

Align the way we perform exhaustive tests for KnownBits with what
we do for ConstantRange. Test each case separately by specifying
a function on KnownBits and one on APInts. Additionally, specify
a callback that determines which cases are supposed to be optimal,
rather than only correct. Unlike the ConstantRange case there is
a well-defined, unique notion of optimality for KnownBits.

If a failure occurs, print out the inputs, computed result and
exact result. Adjust the printing function to produce the output
in a format that is meaningful for KnownBits, i.e. print the
actual known bits, using ? to signify unknowns and ! to signify
conflicts.




More information about the All-commits mailing list