intel/compiler/test: use TEST_DEBUG env var consistently
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Thu, 30 Jul 2020 14:18:37 +0000 (16:18 +0200)
committerMarge Bot <eric+marge@anholt.net>
Wed, 2 Sep 2020 15:08:01 +0000 (15:08 +0000)
Other tests use the same environment variable to decide whether they
should print debugging information.

Will quiet Coverity's "'Constant' variable guards dead code".

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

src/intel/compiler/test_vec4_copy_propagation.cpp
src/intel/compiler/test_vec4_dead_code_eliminate.cpp
src/intel/compiler/test_vec4_register_coalesce.cpp

index 5f3f3e525f23fb5e251f549c3bab15758332f9b2..238f04d265778a6847561884f5a6af862aa7ed39 100644 (file)
@@ -105,7 +105,7 @@ void copy_propagation_test::SetUp()
 static void
 copy_propagation(vec4_visitor *v)
 {
-   bool print = false;
+   const bool print = getenv("TEST_DEBUG");
 
    if (print) {
       fprintf(stderr, "instructions before:\n");
index 25739c2895a428abc8b1e378dce4241a3c5393d0..9bf787f0666da35c2f9766539a8d569b599500d4 100644 (file)
@@ -103,7 +103,7 @@ void dead_code_eliminate_test::SetUp()
 static void
 dead_code_eliminate(vec4_visitor *v)
 {
-   bool print = false;
+   const bool print = getenv("TEST_DEBUG");
 
    if (print) {
       fprintf(stderr, "instructions before:\n");
index 9636db2aca60b9c3359131a15a6e3bfcdea7a422..4621fd64ec66ec0ed45342470e41cad413027099 100644 (file)
@@ -108,7 +108,7 @@ void register_coalesce_test::SetUp()
 static void
 _register_coalesce(vec4_visitor *v, const char *func)
 {
-   bool print = false;
+   const bool print = getenv("TEST_DEBUG");
 
    if (print) {
       printf("%s: instructions before:\n", func);