===================================================================
@@ -119,6 +119,12 @@ typedef union
vector int v;
} vector_int_t;
+#ifdef __LITTLE_ENDIAN__
+#define MAKE_SLOT(x, y) ((long)x | ((long)y << 32))
+#else
+#define MAKE_SLOT(x, y) ((long)y | ((long)x << 32))
+#endif
+
/* Paramter passing.
s : gpr 3
v : vpr 2
@@ -226,8 +232,8 @@ fcevv (char *s, ...)
sp = __builtin_frame_address(0);
sp = sp->backchain;
- if (sp->slot[2].l != 0x100000002ULL
- || sp->slot[4].l != 0x500000006ULL)
+ if (sp->slot[2].l != MAKE_SLOT (1, 2)
+ || sp->slot[4].l != MAKE_SLOT (5, 6))
abort();
}
@@ -268,8 +274,8 @@ fciievv (char *s, int i, int j, ...)
sp = __builtin_frame_address(0);
sp = sp->backchain;
- if (sp->slot[4].l != 0x100000002ULL
- || sp->slot[6].l != 0x500000006ULL)
+ if (sp->slot[4].l != MAKE_SLOT (1, 2)
+ || sp->slot[6].l != MAKE_SLOT (5, 6))
abort();
}
@@ -296,8 +302,8 @@ fcvevv (char *s, vector int x, ...)
sp = __builtin_frame_address(0);
sp = sp->backchain;
- if (sp->slot[4].l != 0x100000002ULL
- || sp->slot[6].l != 0x500000006ULL)
+ if (sp->slot[4].l != MAKE_SLOT (1, 2)
+ || sp->slot[6].l != MAKE_SLOT (5, 6))
abort();
}
===================================================================
@@ -11,7 +11,11 @@ int msw(long long in)
int i[2];
} ud;
ud.ll = in;
+#ifdef __LITTLE_ENDIAN__
+ return ud.i[1];
+#else
return ud.i[0];
+#endif
}
int main()
===================================================================
@@ -2,6 +2,7 @@
! { dg-options "-fno-range-check" }
! { dg-require-effective-target fortran_real_16 }
! { dg-require-effective-target fortran_integer_16 }
+! { dg-skip-if "" { "powerpc*le-*-*" } { "*" } { "" } }
! PR47293 NAN not correctly read
character(len=200) :: str
real(16) :: r