On 06/10/2015 09:24 AM, David Malcolm wrote:
gcc/unittests/ChangeLog:
* test-bitmap.c: New file.
---
gcc/unittests/test-bitmap.c | 117 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 117 insertions(+)
create mode 100644 gcc/unittests/test-bitmap.c
diff --git a/gcc/unittests/test-bitmap.c b/gcc/unittests/test-bitmap.c
new file mode 100644
index 0000000..38adff3
--- /dev/null
+++ b/gcc/unittests/test-bitmap.c
So... We have a long standing issue that we can't iterate on a bitmap
that is changing. I can't recall if it's bits going from set to unset
that causes a problem or vice-versa or both.
There's been talk of putting some sanity checking in the bitmap code to
detect this error. A unit testing framework of this nature would be a
great way to verify that sanity checking worked.
More generally a unit testing framework would allow us to build a suite
that does a positive test on our sanity checking. ie, set up the
invalid state and see if the sanity checking bits complain -- things we
can't do from a source file.
Anyway, the test itself seems like a reasonable start, we just have to
settle the framework issues.
Jeff