[asan] add a test for __attribute__ no_address_safety_analysis

llvm-svn: 149278
This commit is contained in:
Kostya Serebryany 2012-01-30 21:34:59 +00:00
parent a5822c0501
commit cf2c65aa8e
1 changed files with 11 additions and 0 deletions

View File

@ -1668,6 +1668,17 @@ TEST(AddressSanitizer, LargeStructCopyTest) {
*Ident(&a) = *Ident(&a);
}
__attribute__((no_address_safety_analysis))
static void NoAddressSafety() {
char *foo = new char[10];
Ident(foo)[10] = 0;
delete [] foo;
}
TEST(AddressSanitizer, AttributeNoAddressSafetyTest) {
Ident(NoAddressSafety)();
}
// ------------------ demo tests; run each one-by-one -------------
// e.g. --gtest_filter=*DemoOOBLeftHigh --gtest_also_run_disabled_tests
TEST(AddressSanitizer, DISABLED_DemoThreadedTest) {