benchmark/test
Eric 7b03df7ff7
Add tests to verify assembler output -- Fix DoNotOptimize. (#530)
* Add tests to verify assembler output -- Fix DoNotOptimize.

For things like `DoNotOptimize`, `ClobberMemory`, and even `KeepRunning()`,
it is important exactly what assembly they generate. However, we currently
have no way to test this. Instead it must be manually validated every
time a change occurs -- including a change in compiler version.

This patch attempts to introduce a way to test the assembled output automatically.
It's mirrors how LLVM verifies compiler output, and it uses LLVM FileCheck to run
the tests in a similar way.

The tests function by generating the assembly for a test in CMake, and then
using FileCheck to verify the // CHECK lines in the source file are found
in the generated assembly.

Currently, the tests only run on 64-bit x86 systems under GCC and Clang,
and when FileCheck is found on the system.

Additionally, this patch tries to improve the code gen from DoNotOptimize.
This should probably be a separate change, but I needed something to test.

* Disable assembly tests on Bazel for now

* Link FIXME to github issue

* Fix Tests on OS X

* fix strip_asm.py to work on both Linux and OS X like targets
2018-03-23 16:10:47 -06:00
..
AssemblyTests.cmake Add tests to verify assembler output -- Fix DoNotOptimize. (#530) 2018-03-23 16:10:47 -06:00
basic_test.cc Ensure std::iterator_traits<StateIterator> instantiates. 2018-02-21 00:54:19 -07:00
benchmark_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
BUILD Add tests to verify assembler output -- Fix DoNotOptimize. (#530) 2018-03-23 16:10:47 -06:00
clobber_memory_assembly_test.cc Add tests to verify assembler output -- Fix DoNotOptimize. (#530) 2018-03-23 16:10:47 -06:00
CMakeLists.txt Add tests to verify assembler output -- Fix DoNotOptimize. (#530) 2018-03-23 16:10:47 -06:00
complexity_test.cc Refactor most usages of KeepRunning to use the perfered ranged-for. (#459) 2017-10-17 12:17:02 -06:00
cxx03_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
diagnostics_test.cc Refactor most usages of KeepRunning to use the perfered ranged-for. (#459) 2017-10-17 12:17:02 -06:00
donotoptimize_assembly_test.cc Add tests to verify assembler output -- Fix DoNotOptimize. (#530) 2018-03-23 16:10:47 -06:00
donotoptimize_test.cc Fix #342: DoNotOptimize causes compile errors on older GCC versions. (#398) 2017-06-02 15:47:23 -07:00
filter_test.cc Refactor most usages of KeepRunning to use the perfered ranged-for. (#459) 2017-10-17 12:17:02 -06:00
fixture_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
map_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
multiple_ranges_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
options_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
output_test_helper.cc Make output tests more stable on slow machines. 2018-02-12 19:07:19 -07:00
output_test.h Improve some comments. 2017-05-01 23:02:35 +01:00
register_benchmark_test.cc Refactor most usages of KeepRunning to use the perfered ranged-for. (#459) 2017-10-17 12:17:02 -06:00
reporter_output_test.cc Print the executable name as part of the context. (#534) 2018-02-21 08:43:57 -08:00
skip_with_error_test.cc Support State::KeepRunningBatch(). (#521) 2018-02-09 21:57:04 -07:00
state_assembly_test.cc Add tests to verify assembler output -- Fix DoNotOptimize. (#530) 2018-03-23 16:10:47 -06:00
statistics_test.cc Add support for GTest based unit tests. (#485) 2017-12-13 16:26:47 -07:00
templated_fixture_test.cc Enforce using a semicolon after BENCHMARK_MAIN to remove compiler warnings (#495) 2017-12-03 18:45:07 -07:00
user_counters_tabular_test.cc Refactor most usages of KeepRunning to use the perfered ranged-for. (#459) 2017-10-17 12:17:02 -06:00
user_counters_test.cc Refactor most usages of KeepRunning to use the perfered ranged-for. (#459) 2017-10-17 12:17:02 -06:00