[PATCH] D26763: [compiler-rt] [asan] Use __SSE2__ (rather than __i686__...) for SSE2 test

Michał Górny via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 16 12:41:26 PST 2016


mgorny created this revision.
mgorny added a reviewer: kcc.
mgorny added a subscriber: cfe-commits.
Herald added subscribers: dberris, kubabrecka.

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.


https://reviews.llvm.org/D26763

Files:
  lib/asan/tests/asan_test.cc


Index: lib/asan/tests/asan_test.cc
===================================================================
--- lib/asan/tests/asan_test.cc
+++ lib/asan/tests/asan_test.cc
@@ -692,7 +692,7 @@
   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)));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26763.78245.patch
Type: text/x-patch
Size: 394 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161116/12fe2ce1/attachment.bin>


More information about the cfe-commits mailing list