[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

llvm-svn: 176014
This commit is contained in:
Alexey Samsonov 2013-02-25 09:00:03 +00:00
parent 85f0a7e644
commit b2ac280f96
2 changed files with 4 additions and 4 deletions

View File

@ -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})

View File

@ -31,7 +31,7 @@ class FastUnwindTest : public ::testing::Test {
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]);