[compiler-rt] r176014 - [Sanitizer] fix signed/unsigned compare warnings in sanitizer_stacktrace_test. Build sanitizer_common tests with -Werror as we use predictable just-built Clang for building them
Alexey Samsonov
samsonov at google.com
Mon Feb 25 01:00:03 PST 2013
Author: samsonov
Date: Mon Feb 25 03:00:03 2013
New Revision: 176014
URL: http://llvm.org/viewvc/llvm-project?rev=176014&view=rev
Log:
[Sanitizer] fix signed/unsigned compare warnings in sanitizer_stacktrace_test. Build sanitizer_common tests with -Werror as we use predictable just-built Clang for building them
Modified:
compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt?rev=176014&r1=176013&r2=176014&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/CMakeLists.txt Mon Feb 25 03:00:03 2013
@@ -54,7 +54,7 @@ macro(add_sanitizer_tests_for_arch arch)
-I${COMPILER_RT_SOURCE_DIR}/include
-I${COMPILER_RT_SOURCE_DIR}/lib
-I${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common
- -O2 -g ${TARGET_FLAGS})
+ -O2 -g -Wall -Werror ${TARGET_FLAGS})
set(SANITIZER_TEST_LINK_FLAGS -lstdc++ -lpthread ${TARGET_FLAGS})
set(SANITIZER_TEST_OBJECTS)
foreach(source ${SANITIZER_TEST_SOURCES})
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc?rev=176014&r1=176013&r2=176014&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc Mon Feb 25 03:00:03 2013
@@ -31,7 +31,7 @@ class FastUnwindTest : public ::testing:
void FastUnwindTest::SetUp() {
// Fill an array of pointers with fake fp+retaddr pairs. Frame pointers have
// even indices.
- for (int i = 0; i+1 < ARRAY_SIZE(fake_stack); i += 2) {
+ for (uptr i = 0; i+1 < ARRAY_SIZE(fake_stack); i += 2) {
fake_stack[i] = (uptr)&fake_stack[i+2]; // fp
fake_stack[i+1] = i+1; // retaddr
}
@@ -54,7 +54,7 @@ TEST_F(FastUnwindTest, Basic) {
trace.FastUnwindStack(start_pc, (uptr)&fake_stack[0],
fake_top, fake_bottom);
// Should get all on-stack retaddrs and start_pc.
- EXPECT_EQ(6, trace.size);
+ EXPECT_EQ(6U, trace.size);
EXPECT_EQ(start_pc, trace.trace[0]);
for (int i = 1; i <= 5; i++) {
EXPECT_EQ(i*2 - 1, trace.trace[i]);
@@ -68,7 +68,7 @@ TEST_F(FastUnwindTest, FramePointerLoop)
trace.FastUnwindStack(start_pc, (uptr)&fake_stack[0],
fake_top, fake_bottom);
// Should get all on-stack retaddrs up to the 4th slot and start_pc.
- EXPECT_EQ(4, trace.size);
+ EXPECT_EQ(4U, trace.size);
EXPECT_EQ(start_pc, trace.trace[0]);
for (int i = 1; i <= 3; i++) {
EXPECT_EQ(i*2 - 1, trace.trace[i]);
More information about the llvm-commits
mailing list