aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c')
-rw-r--r--gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c b/gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c
index 97ef14488..3e0e6a079 100644
--- a/gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c
+++ b/gcc-4.8/gcc/testsuite/gcc.dg/vmx/gcc-bug-i.c
@@ -13,12 +13,27 @@
#define DO_INLINE __attribute__ ((always_inline))
#define DONT_INLINE __attribute__ ((noinline))
+#ifdef __LITTLE_ENDIAN__
+static inline DO_INLINE int inline_me(vector signed short data)
+{
+ union {vector signed short v; signed short s[8];} u;
+ signed short x;
+ unsigned char x1, x2;
+
+ u.v = data;
+ x = u.s[7];
+ x1 = (x >> 8) & 0xff;
+ x2 = x & 0xff;
+ return ((x2 << 8) | x1);
+}
+#else
static inline DO_INLINE int inline_me(vector signed short data)
{
union {vector signed short v; signed short s[8];} u;
u.v = data;
return u.s[7];
}
+#endif
static DONT_INLINE int foo(vector signed short data)
{