[llvm-commits] [compiler-rt] r151888 - /compiler-rt/trunk/lib/asan/tests/asan_test.cc

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Mar 2 02:42:10 PST 2012


Author: eugenis
Date: Fri Mar  2 04:42:10 2012
New Revision: 151888

URL: http://llvm.org/viewvc/llvm-project?rev=151888&view=rev
Log:
[asan] Add a negative test for memcpy of long double.

Modified:
    compiler-rt/trunk/lib/asan/tests/asan_test.cc

Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=151888&r1=151887&r2=151888&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Fri Mar  2 04:42:10 2012
@@ -1944,6 +1944,14 @@
 
 #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";





More information about the llvm-commits mailing list