aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/darwin-longlong.c
diff options
context:
space:
mode:
authorno-author <no-author@gcc.gnu.org>2004-02-12 20:15:57 +0000
committerno-author <no-author@gcc.gnu.org>2004-02-12 20:15:57 +0000
commit5ce35163972a168c33c34b1ed753d16747f73ef3 (patch)
tree03bdff41b9946151953d965b51d3352fd8baf64d /gcc/testsuite/gcc.dg/darwin-longlong.c
parente8461705deb66941c2b0ae4ae0ed44637b44c345 (diff)
This commit was manufactured by cvs2svn to create branch
'tree-ssa-20020619-branch'. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@77725 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/darwin-longlong.c')
-rw-r--r--gcc/testsuite/gcc.dg/darwin-longlong.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/darwin-longlong.c b/gcc/testsuite/gcc.dg/darwin-longlong.c
new file mode 100644
index 00000000000..9a1dcd2c85f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/darwin-longlong.c
@@ -0,0 +1,38 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-mcpu=G5" } */
+
+#include <signal.h>
+
+void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+
+int msw(long long in)
+{
+ union {
+ long long ll;
+ int i[2];
+ } ud;
+ ud.ll = in;
+ return ud.i[0];
+}
+
+int main()
+{
+
+ /* Exit on systems without 64bit instructions. */
+ signal (SIGILL, sig_ill_handler);
+#ifdef __MACH__
+ asm volatile ("extsw r0,r0");
+#else
+ asm volatile ("extsw 0,0");
+#endif
+ signal (SIGILL, SIG_DFL);
+
+ if (msw(1) != 0)
+ abort();
+ exit(0);
+}