[llvm-commits] [compiler-rt] r162745 - in /compiler-rt/trunk/lib/asan: Makefile.old tests/asan_noinst_test.cc
Kostya Serebryany
kcc at google.com
Tue Aug 28 04:21:01 PDT 2012
Author: kcc
Date: Tue Aug 28 06:21:01 2012
New Revision: 162745
URL: http://llvm.org/viewvc/llvm-project?rev=162745&view=rev
Log:
[asan] improve SetErrorReportCallbackTest to actually catch missing functionality in __asan_set_error_report_callback
Modified:
compiler-rt/trunk/lib/asan/Makefile.old
compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
Modified: compiler-rt/trunk/lib/asan/Makefile.old
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/Makefile.old?rev=162745&r1=162744&r2=162745&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/Makefile.old (original)
+++ compiler-rt/trunk/lib/asan/Makefile.old Tue Aug 28 06:21:01 2012
@@ -237,7 +237,7 @@
# cp -v $(CLANG_BUILD)/lib/libasan*.a $(INSTALL_DIR)/lib
$(BIN)/asan_noinst_test$(SUFF).o: tests/asan_noinst_test.cc $(RTL_HDR) $(MAKEFILE)
- $(CLEANROOM_CXX) $(PIE) $(CFLAGS) $(GTEST_INCLUDE) -I. -I.. -g -c $< -O2 -o $@
+ $(CLEANROOM_CXX) $(COMMON_ASAN_DEFINES) $(PIE) $(CFLAGS) $(GTEST_INCLUDE) -I. -I.. -g -c $< -O2 -o $@
$(BIN)/asan_break_optimization$(SUFF).o: tests/asan_break_optimization.cc $(MAKEFILE)
$(CLEANROOM_CXX) $(PIE) $(CFLAGS) -c $< -O0 -o $@
Modified: compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc?rev=162745&r1=162744&r2=162745&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_noinst_test.cc Tue Aug 28 06:21:01 2012
@@ -17,6 +17,7 @@
#include "asan_mapping.h"
#include "asan_stack.h"
#include "asan_test_utils.h"
+#include "asan_test_config.h"
#include <assert.h>
#include <stdio.h>
@@ -677,11 +678,15 @@
static void ErrorReportCallbackOneToZ(const char *report) {
write(2, "ABCDEF", 6);
+ write(2, report, strlen(report));
+ write(2, "ABCDEF", 6);
+ _exit(1);
}
TEST(AddressSanitizerInterface, SetErrorReportCallbackTest) {
__asan_set_error_report_callback(ErrorReportCallbackOneToZ);
- EXPECT_DEATH(__asan_report_error(0, 0, 0, 0, true, 1), "ABCDEF");
+ EXPECT_DEATH(__asan_report_error(0, 0, 0, 0, true, 1),
+ ASAN_PCRE_DOTALL "ABCDEF.*AddressSanitizer.*WRITE.*ABCDEF");
__asan_set_error_report_callback(NULL);
}
More information about the llvm-commits
mailing list