This is an archive of the discontinued LLVM Phabricator instance.

[mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS
ClosedPublic

Authored by sdkie on Dec 1 2014, 5:49 AM.

Details

Summary

Enabling COMPILER_RT_INCLUDE_TESTS and updating tests/sanitizer_allocator_test.cc to remove Allocator64 related tests for MIPS.

Diff Detail

Event Timeline

sdkie updated this revision to Diff 16761.Dec 1 2014, 5:49 AM
sdkie retitled this revision from to [mips] [test] Enable COMPILER_RT_INCLUDE_TESTS for MIPS.
sdkie updated this object.
sdkie edited the test plan for this revision. (Show Details)
sdkie added reviewers: kcc, samsonov, earthdok.
sdkie set the repository for this revision to rL LLVM.
sdkie added subscribers: Unknown Object (MLST), mohit.bhakkad, slthakur and 2 others.
samsonov added inline comments.Dec 1 2014, 12:45 PM
lib/sanitizer_common/tests/CMakeLists.txt
166

Please introduce a CMake variable to store a list of architectures that are support in unit tests (by calling filter_available_targets) and use a foreach() loop here and below instead.

sdkie updated this revision to Diff 16801.Dec 2 2014, 1:03 AM
  • Introduced new CMake variable 'SANITIZER_TEST_SUPPORTED_ARCH'
  • Fixed Printf.Basic Test
samsonov added inline comments.Dec 2 2014, 12:07 PM
lib/sanitizer_common/tests/CMakeLists.txt
5

Let's name it as SANITIZER_UNITTEST_SUPPORTED_ARCH.

Also, please add a FIXME to just use SANITIZER_COMMON_SUPPORTED_ARCH here.

lib/sanitizer_common/tests/sanitizer_allocator_test.cc
32

This line makes no sense - probably you've meant

#if SANITIZER_CAN_USE_ALLOCATOR64

?

lib/sanitizer_common/tests/sanitizer_printf_test.cc
30–31

I'd prefer to build the expected string for arbitrary value of SANITIZER_POINTER_FORMAT_LENGTH instead.

sdkie updated this revision to Diff 16981.Dec 4 2014, 10:12 PM

updated patch as per suggestions of @samsonov

samsonov added inline comments.Dec 5 2014, 12:08 PM
lib/sanitizer_common/tests/sanitizer_allocator_test.cc
384

Why do you need this change? This test case seems to test LargeMmapAllocator, not SizeClassAllocator64.

lib/sanitizer_common/tests/sanitizer_printf_test.cc
34

OMG, please no "+26". Just use std::string here.

sdkie added inline comments.Dec 8 2014, 3:49 AM
lib/sanitizer_common/tests/sanitizer_printf_test.cc
34

Sorry didn't got you.
Should I use ?

memset(expectedString + strlen(expectedString), '0', SANITIZER_POINTER_FORMAT_LENGTH - 3);
samsonov added inline comments.Dec 8 2014, 11:33 AM
lib/sanitizer_common/tests/sanitizer_printf_test.cc
34

No. Please use std::string from STL (http://www.cplusplus.com/reference/string/string/). It overloads operator+ and allows you to concatenate strings easier. You also don't have to care about calculating the size of the buffer (in your case you assumed it would never ever be larger than 70) yourself.

sdkie updated this revision to Diff 17163.Dec 11 2014, 5:04 AM
  • used std::string instead of char in lib/sanitizer_common/tests/sanitizer_printf_test.cc
  • fixed lib/sanitizer_common/tests/sanitizer_allocator_test.cc:384
samsonov accepted this revision.Dec 11 2014, 10:06 AM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 11 2014, 10:06 AM