[compiler-rt] r287245 - [tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN test

Michal Gorny via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 10:41:54 PST 2016


Author: mgorny
Date: Thu Nov 17 12:41:54 2016
New Revision: 287245

URL: http://llvm.org/viewvc/llvm-project?rev=287245&view=rev
Log:
[tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN test

Use the __SSE2__ to determine whether SSE2 is enabled in the ASAN tests
rather than relying on either of the __i686__ and __x86_64__. The former
is only set with explicit -march=i686, and therefore misses most of
the x86 CPUs that support SSE2. __SSE2__ is in turn defined if
the current settings (-march, -msse2) indicate that SSE2 is supported
which should be more reliable.

Differential Revision: https://reviews.llvm.org/D26763

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=287245&r1=287244&r2=287245&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Thu Nov 17 12:41:54 2016
@@ -692,7 +692,7 @@ TEST(AddressSanitizer, ThreadStackReuseT
   PTHREAD_JOIN(t, 0);
 }
 
-#if defined(__i686__) || defined(__x86_64__)
+#if defined(__SSE2__)
 #include <emmintrin.h>
 TEST(AddressSanitizer, Store128Test) {
   char *a = Ident((char*)malloc(Ident(12)));




More information about the llvm-commits mailing list