forked from OSchip/llvm-project
[asan] add a test for __attribute__ no_address_safety_analysis
llvm-svn: 149278
This commit is contained in:
parent
a5822c0501
commit
cf2c65aa8e
|
@ -1668,6 +1668,17 @@ TEST(AddressSanitizer, LargeStructCopyTest) {
|
||||||
*Ident(&a) = *Ident(&a);
|
*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 -------------
|
// ------------------ demo tests; run each one-by-one -------------
|
||||||
// e.g. --gtest_filter=*DemoOOBLeftHigh --gtest_also_run_disabled_tests
|
// e.g. --gtest_filter=*DemoOOBLeftHigh --gtest_also_run_disabled_tests
|
||||||
TEST(AddressSanitizer, DISABLED_DemoThreadedTest) {
|
TEST(AddressSanitizer, DISABLED_DemoThreadedTest) {
|
||||||
|
|
Loading…
Reference in New Issue