[Openmp-dev] LIT. tests for OpenMPOpt

Michael Kruse via Openmp-dev openmp-dev at lists.llvm.org
Mon Jan 25 07:57:07 PST 2021


Am Mo., 25. Jan. 2021 um 08:11 Uhr schrieb Abid Malik via Openmp-dev
<openmp-dev at lists.llvm.org>:
> 1) Why running. opt twice on some parallel region tests?
> ; RUN: opt -S -attributor -openmpopt  < %s | FileCheck %s
> ; RUN: opt -S -passes='attributor,cgscc(openmpopt)'  < %s | FileCheck %s

The first line is testing with the legacy pass manager (at least this
was the idea at some point, with EXPERIMENTAL_NEW_PASS_MANAGER=ON flag
it tries to use the new pass manager even when using the legacy pass
manager command line interface), the latter with the new pass manager.
It is typical to have multiple run lines to run the same test input
with different options.

> 2) Why we are not using -O3 flag? does -openmpopt flag enough for OpenMPOpt?

-O3 would add many other passes to the pass manager, but this test is
meant to only test the attributor. Add unrelated passes would render
the test very flaky as any change of these could cause this test to
fail.

Testing with -O3 would be more akin to an end-to-end test, which is
what we do with the llvm-test-suite.

> 3) It does not print any text or statement for debugging

Tests are not supposed to check debug output. Debug output is meant to
help to find an issue, i.e humans-readable, whereas regression tests
only check the (machine-readable) output. To get more detailed debug
output, you might want to add more LLVM_DEBUG(dbgs() << ...) which, if
checked in regression tests, would cause tests to break.

Unfortunately we do have many tests that also check debug output.


Michael


More information about the Openmp-dev mailing list