[PATCH] D34022: Repair 2010-05-31-palignr.c test

Raphael Isemann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 8 01:08:01 PDT 2017


teemperor created this revision.

This test was silently failing since a long time because it failed to include stdlib.h (as it's running in a freestanding environment). However, because we used just `not clang_cc1` instead of the verify mode, this regression was never noticed and the test was just always passing.

This adds -ffreestanding to the invocation, so that tmmintrin.h doesn't indirectly include mm_malloc.h, which in turns includes the unavailable stdlib.h. We also run now in the -verify mode to prevent that we silently regress again.

I've also updated the test to no longer check the return value of `_mm_alignr_epi8` as this is also causing it to fail (and it's not really the job of this test to test this).


https://reviews.llvm.org/D34022

Files:
  test/Sema/2010-05-31-palignr.c


Index: test/Sema/2010-05-31-palignr.c
===================================================================
--- test/Sema/2010-05-31-palignr.c
+++ test/Sema/2010-05-31-palignr.c
@@ -1,22 +1,20 @@
-// RUN: not %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o /dev/null %s
+// RUN: %clang_cc1  -ffreestanding -verify -fsyntax-only %s
 
 #include <tmmintrin.h>
+#include <stdint.h>
 
 extern int i;
 
 int main ()
 {
-#if defined( __SSSE3__ )
-
   typedef int16_t     vSInt16         __attribute__ ((__vector_size__ (16)));
 
   short   dtbl[] = {1,2,3,4,5,6,7,8};
   vSInt16 *vdtbl = (vSInt16*) dtbl;
 
   vSInt16 v0;
   v0 = *vdtbl;
-  v0 = _mm_alignr_epi8(v0, v0, i); // expected-error {{argument to '__builtin_ia32_palignr128' must be a constant integer}}
+  _mm_alignr_epi8(v0, v0, i); // expected-error {{argument to '__builtin_ia32_palignr128' must be a constant integer}}
 
   return 0;
-#endif
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34022.101866.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170608/0b661b1b/attachment.bin>


More information about the cfe-commits mailing list