[tests] Use __SSE2__ (rather than __i686__...) for SSE2 ASAN test
authorMichal Gorny <mgorny@gentoo.org>
Thu, 17 Nov 2016 18:41:54 +0000 (18:41 +0000)
committerMichal Gorny <mgorny@gentoo.org>
Thu, 17 Nov 2016 18:41:54 +0000 (18:41 +0000)
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

llvm-svn: 287245

compiler-rt/lib/asan/tests/asan_test.cc

index 6a95c3f..424a79e 100644 (file)
@@ -692,7 +692,7 @@ TEST(AddressSanitizer, ThreadStackReuseTest) {
   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)));