aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@gcc.gnu.org>2004-01-26 17:48:49 +0000
committerFariborz Jahanian <fjahanian@gcc.gnu.org>2004-01-26 17:48:49 +0000
commitb2037eac294895d135551d4ffae674c3a4d637a2 (patch)
tree54693384020489ad519cf0d30f3971cd99328566 /gcc
parent6c8066b9ca1dc817d1620af3e6694444f87944ca (diff)
downloadgcc-b2037eac294895d135551d4ffae674c3a4d637a2.zip
gcc-b2037eac294895d135551d4ffae674c3a4d637a2.tar.gz
gcc-b2037eac294895d135551d4ffae674c3a4d637a2.tar.bz2
Test case for PR middle-end/13779.
From-SVN: r76652
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/darwin-longlong.c34
1 files changed, 34 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 0000000..ef925d6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/darwin-longlong.c
@@ -0,0 +1,34 @@
+/* { 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);
+ asm volatile ("extsw r0,r0");
+ signal (SIGILL, SIG_DFL);
+
+ if (msw(1) != 0)
+ abort();
+ exit(0);
+}