From: Marcin Ślusarz Date: Thu, 30 Jul 2020 14:18:37 +0000 (+0200) Subject: intel/compiler/test: use TEST_DEBUG env var consistently X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c7a9dc76dce09d4f23260d26c629a91ef02514a0;p=mesa.git intel/compiler/test: use TEST_DEBUG env var consistently 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 Reviewed-by: Lionel Landwerlin Part-of: --- diff --git a/src/intel/compiler/test_vec4_copy_propagation.cpp b/src/intel/compiler/test_vec4_copy_propagation.cpp index 5f3f3e525f2..238f04d2657 100644 --- a/src/intel/compiler/test_vec4_copy_propagation.cpp +++ b/src/intel/compiler/test_vec4_copy_propagation.cpp @@ -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"); diff --git a/src/intel/compiler/test_vec4_dead_code_eliminate.cpp b/src/intel/compiler/test_vec4_dead_code_eliminate.cpp index 25739c2895a..9bf787f0666 100644 --- a/src/intel/compiler/test_vec4_dead_code_eliminate.cpp +++ b/src/intel/compiler/test_vec4_dead_code_eliminate.cpp @@ -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"); diff --git a/src/intel/compiler/test_vec4_register_coalesce.cpp b/src/intel/compiler/test_vec4_register_coalesce.cpp index 9636db2aca6..4621fd64ec6 100644 --- a/src/intel/compiler/test_vec4_register_coalesce.cpp +++ b/src/intel/compiler/test_vec4_register_coalesce.cpp @@ -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);