Module: Mesa
Branch: master
Commit: c7a9dc76dce09d4f23260d26c629a91ef02514a0
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7a9dc76dce09d4f23260d26c629a91ef02514a0

Author: Marcin Ślusarz <[email protected]>
Date:   Thu Jul 30 16:18:37 2020 +0200

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 <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6126>

---

 src/intel/compiler/test_vec4_copy_propagation.cpp    | 2 +-
 src/intel/compiler/test_vec4_dead_code_eliminate.cpp | 2 +-
 src/intel/compiler/test_vec4_register_coalesce.cpp   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to