[llvm-commits] [llvm-gcc-4.2] r56744 - /llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6025404.c

Bill Wendling isanbard at gmail.com
Fri Sep 26 17:53:23 PDT 2008


Author: void
Date: Fri Sep 26 19:53:22 2008
New Revision: 56744

URL: http://llvm.org/viewvc/llvm-project?rev=56744&view=rev
Log:
Testcase for non-commutative.

Added:
    llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6025404.c

Added: llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6025404.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6025404.c?rev=56744&view=auto

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6025404.c (added)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/gcc.apple/6025404.c Fri Sep 26 19:53:22 2008
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file 6025404 */
+/* { dg-do run { target i?86*-*-darwin* } } */
+/* { dg-options "-O3 -mssse3" } */
+#include <stdio.h>
+#include <tmmintrin.h>
+void foo(__m128i *a, __m128i *b, __m128i c, __m128i d, __m128i e)
+{
+  *a = _mm_maddubs_epi16(c, d);
+  *b = _mm_maddubs_epi16(c, e);
+}
+int main(void)
+{
+  union { char c[16]; __m128i v; } c = { -1 }, d = { 1 }, e = { 1 };
+  union { short s[8]; __m128i v; } a, b;
+
+  foo(&a.v, &b.v, c.v, d.v, e.v);
+
+  if (0)
+    {
+      printf("a contains %d.\n", a.s[0]); 
+      printf("b contains %d.\n", b.s[0]);
+    }
+
+  if (a.s[0] != 255)
+    abort () ;
+  if (b.s[0] != 255)
+    abort () ;
+
+  return 0;
+}





More information about the llvm-commits mailing list