summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2012-03-02 10:42:10 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2012-03-02 10:42:10 +0000
commitf485c3ccbdc143d1e36b5463f5dd78b9b6ee27e8 (patch)
tree9453c4ec397c69d452852fb14957a4bd1e6d329b
parentd33e3d8c6e5f0d92451a3e56320b9f81ae664c50 (diff)
downloadbcm5719-llvm-f485c3ccbdc143d1e36b5463f5dd78b9b6ee27e8.tar.gz
bcm5719-llvm-f485c3ccbdc143d1e36b5463f5dd78b9b6ee27e8.zip
[asan] Add a negative test for memcpy of long double.
llvm-svn: 151888
-rw-r--r--compiler-rt/lib/asan/tests/asan_test.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/tests/asan_test.cc b/compiler-rt/lib/asan/tests/asan_test.cc
index 7a381985885..b518d43a0b5 100644
--- a/compiler-rt/lib/asan/tests/asan_test.cc
+++ b/compiler-rt/lib/asan/tests/asan_test.cc
@@ -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";
OpenPOWER on IntegriCloud