[llvm-branch-commits] [compiler-rt-branch] r270402 - Merging r262302:

Mohit K. Bhakkad via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon May 23 01:22:23 PDT 2016


Author: mohit.bhakkad
Date: Mon May 23 03:19:11 2016
New Revision: 270402

URL: http://llvm.org/viewvc/llvm-project?rev=270402&view=rev
Log:
Merging r262302:
------------------------------------------------------------------------
r262302 | mohit.bhakkad | 2016-03-01 11:23:30 +0530 (Tue, 01 Mar 2016) | 7 lines

[Compiler-rt][MSan] fix param_tls_limit test for platforms where big arguments are sliced in smaller ones

Reviewers: eugenis

Subscribers: dsanders, jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17129
------------------------------------------------------------------------

Modified:
    compiler-rt/branches/release_38/   (props changed)
    compiler-rt/branches/release_38/test/msan/param_tls_limit.cc

Propchange: compiler-rt/branches/release_38/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon May 23 03:19:11 2016
@@ -1 +1 @@
-/compiler-rt/trunk:258916,259755,260669,260839,260946,261073,261142,261148,261193,261263,261513,261721,261723,261837,261982
+/compiler-rt/trunk:258916,259755,260669,260839,260946,261073,261142,261148,261193,261263,261513,261721,261723,261837,261982,262302

Modified: compiler-rt/branches/release_38/test/msan/param_tls_limit.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_38/test/msan/param_tls_limit.cc?rev=270402&r1=270401&r2=270402&view=diff
==============================================================================
--- compiler-rt/branches/release_38/test/msan/param_tls_limit.cc (original)
+++ compiler-rt/branches/release_38/test/msan/param_tls_limit.cc Mon May 23 03:19:11 2016
@@ -20,6 +20,17 @@
 // In case of no overflow, it is still poisoned.
 #define NO_OVERFLOW(x) assert(__msan_test_shadow(&x, sizeof(x)) == 0)
 
+#if defined(__x86_64__)
+// In x86_64, if argument is partially outside tls, it is considered completly
+// unpoisoned
+#define PARTIAL_OVERFLOW(x) OVERFLOW(x)
+#else
+// In other archs, bigger arguments are splitted in multiple IR arguments, so
+// they are considered poisoned till tls limit. Checking last byte of such arg:
+#define PARTIAL_OVERFLOW(x) assert(__msan_test_shadow((char *)(&(x) + 1) - 1, 1) == -1)
+#endif
+
+
 template<int N>
 struct S {
   char x[N];
@@ -34,17 +45,17 @@ void f800(S<800> s) {
 }
 
 void f801(S<801> s) {
-  OVERFLOW(s);
+  PARTIAL_OVERFLOW(s);
 }
 
 void f1000(S<1000> s) {
-  OVERFLOW(s);
+  PARTIAL_OVERFLOW(s);
 }
 
 void f_many(int a, double b, S<800> s, int c, double d) {
   NO_OVERFLOW(a);
   NO_OVERFLOW(b);
-  OVERFLOW(s);
+  PARTIAL_OVERFLOW(s);
   OVERFLOW(c);
   OVERFLOW(d);
 }
@@ -54,7 +65,7 @@ void f_many(int a, double b, S<800> s, i
 void f_many2(int a, S<800 - 8 - 2> s, int c, double d) {
   NO_OVERFLOW(a);
   NO_OVERFLOW(s);
-  OVERFLOW(c);
+  PARTIAL_OVERFLOW(c);
   OVERFLOW(d);
 }
 




More information about the llvm-branch-commits mailing list