[asan] Add a negative test for memcpy of long double.

llvm-svn: 151888
This commit is contained in:
Evgeniy Stepanov 2012-03-02 10:42:10 +00:00
parent d33e3d8c6e
commit f485c3ccbd
1 changed files with 8 additions and 0 deletions

View File

@ -1944,6 +1944,14 @@ TEST(AddressSanitizerMac, CFStringCreateCopy) {
#endif // __APPLE__
// Test that instrumentation of stack allocations takes into account
// AllocSize of a type, and not its StoreSize (16 vs 10 bytes for long double).
// See http://llvm.org/bugs/show_bug.cgi?id=12047 for more details.
TEST(AddressSanitizer, LongDoubleNegativeTest) {
long double a, b;
memcpy(Ident(&a), Ident(&b), sizeof(long double));
};
int main(int argc, char **argv) {
progname = argv[0];
testing::GTEST_FLAG(death_test_style) = "threadsafe";