diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2004-05-21 00:13:04 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2004-05-20 17:13:04 -0700 |
commit | d05aa0afd8969e6c6e58f63795ffb0ffd89b5378 (patch) | |
tree | 613d155edd596c65b7139234859a5879899e2fee /gcc | |
parent | f69a11209a5eb346e0e79ea95060d7c22999c210 (diff) | |
download | gcc-d05aa0afd8969e6c6e58f63795ffb0ffd89b5378.zip gcc-d05aa0afd8969e6c6e58f63795ffb0ffd89b5378.tar.gz gcc-d05aa0afd8969e6c6e58f63795ffb0ffd89b5378.tar.bz2 |
re PR target/15301 ([3.3/3.4 only] gcc does not pass __m128 arguments correctly)
2004-05-20 H.J. Lu <hongjiu.lu@intel.com>
PR target/15301
* gcc.dg/compat/union-m128-1.h: New file.
* gcc.dg/compat/union-m128-1_main.c: Likewise.
* gcc.dg/compat/union-m128-1_x.c: Likewise.
* gcc.dg/compat/union-m128-1_y.c: Likewise.
From-SVN: r82077
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/union-m128-1.h | 17 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/union-m128-1_main.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/union-m128-1_x.c | 26 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/compat/union-m128-1_y.c | 29 |
5 files changed, 101 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f2fa8f4..99dcf88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,13 @@ 2004-05-20 H.J. Lu <hongjiu.lu@intel.com> + PR target/15301 + * gcc.dg/compat/union-m128-1.h: New file. + * gcc.dg/compat/union-m128-1_main.c: Likewise. + * gcc.dg/compat/union-m128-1_x.c: Likewise. + * gcc.dg/compat/union-m128-1_y.c: Likewise. + +2004-05-20 H.J. Lu <hongjiu.lu@intel.com> + PR target/15302 * gcc.dg/compat/struct-complex-1.h: New file. * gcc.dg/compat/struct-complex-1_main.c: Likewise. diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1.h b/gcc/testsuite/gcc.dg/compat/union-m128-1.h new file mode 100644 index 0000000..56d80cb --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1.h @@ -0,0 +1,17 @@ +#include <xmmintrin.h> + +typedef struct +{ + __m128 x; +} SS_struct_mi128; + +typedef union +{ + __m128 x; +} SS_union_mi128; + +typedef union +{ + __m128 x; + unsigned long long u[2]; +} union_mi128; diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c new file mode 100644 index 0000000..69dd34d --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_main.c @@ -0,0 +1,21 @@ +/* { dg-options "-O" } */ + +#ifdef __x86_64__ +/* Test function argument passing. PR target/15301. */ + +extern void union_m128_1_x (void); +extern void exit (int); + +int +main () +{ + union_m128_1_x (); + exit (0); +} +#else +int +main () +{ + return 0; +} +#endif diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c new file mode 100644 index 0000000..0a6f886 --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c @@ -0,0 +1,26 @@ +/* { dg-options "-O" } */ + +#ifdef __x86_64__ +#include "union-m128-1.h" + +SS_union_mi128 un; +SS_struct_mi128 st; + +extern void bar (); +extern void foo (); + +void +union_m128_1_x () +{ + union_mi128 x; + + x.u [0] = 0x123456789abcedf0LL; + x.u [1] = 0xfedcba9876543210LL; + un.x = x.x; + st.x = x.x; + bar(un); + bar(st); + foo(un); + foo(st); +} +#endif diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c new file mode 100644 index 0000000..153ed7d --- /dev/null +++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_y.c @@ -0,0 +1,29 @@ +/* { dg-options "-O" } */ + +#ifdef __x86_64__ +#include <stdlib.h> + +#include "union-m128-1.h" + +void +bar (SS_union_mi128 un) +{ + union_mi128 x; + + x.x = un.x; + if (x.u [0] != 0x123456789abcedf0LL + || x.u [1] != 0xfedcba9876543210LL) + abort (); +} + +void +foo (SS_struct_mi128 st) +{ + union_mi128 x; + + x.x = st.x; + if (x.u [0] != 0x123456789abcedf0LL + || x.u [1] != 0xfedcba9876543210LL) + abort (); +} +#endif |