[compiler-rt] d2b574a - tsan: test: Initialize all fields of Params struct

Marco Elver via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 17 08:00:01 PDT 2021


Author: Marco Elver
Date: 2021-08-17T16:58:00+02:00
New Revision: d2b574a4dea5b718e4386bf2e26af0126e5978ce

URL: https://github.com/llvm/llvm-project/commit/d2b574a4dea5b718e4386bf2e26af0126e5978ce
DIFF: https://github.com/llvm/llvm-project/commit/d2b574a4dea5b718e4386bf2e26af0126e5978ce.diff

LOG: tsan: test: Initialize all fields of Params struct

Some compilers started complaining about the test:

	tsan_trace_test.cpp:128:21: error: missing field 'type' initializer

Fix it by initializing all 5 fields, even though the type field will be
reset in the for loop.

Differential Revision: https://reviews.llvm.org/D108207

Added: 
    

Modified: 
    compiler-rt/lib/tsan/tests/unit/tsan_trace_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/tsan/tests/unit/tsan_trace_test.cpp b/compiler-rt/lib/tsan/tests/unit/tsan_trace_test.cpp
index 571fc0ab04b8..f9d9b645335b 100644
--- a/compiler-rt/lib/tsan/tests/unit/tsan_trace_test.cpp
+++ b/compiler-rt/lib/tsan/tests/unit/tsan_trace_test.cpp
@@ -125,10 +125,10 @@ TEST(Trace, MemoryAccessSize) {
     }
   };
   Thread::Params tests[] = {
-      {1, 0, 1, true},  {4, 0, 2, true},
-      {4, 2, 2, true},  {8, 3, 1, true},
-      {2, 1, 1, true},  {1, 1, 1, false},
-      {8, 5, 4, false}, {4, static_cast<uptr>(-1l), 4, false},
+      {1, 0, 1, true, 0},  {4, 0, 2, true, 0},
+      {4, 2, 2, true, 0},  {8, 3, 1, true, 0},
+      {2, 1, 1, true, 0},  {1, 1, 1, false, 0},
+      {8, 5, 4, false, 0}, {4, static_cast<uptr>(-1l), 4, false, 0},
   };
   for (auto params : tests) {
     for (params.type = 0; params.type < 3; params.type++)


        


More information about the llvm-commits mailing list