OSDN Git Service

* gcc.dg/20020201-1.c: Use cleanup-coverage_files.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / darwin-longlong.c
1 /* { dg-do run { target powerpc*-*-* } } */
2 /* { dg-xfail-if "" { "powerpc-*-eabispe*" "powerpc-ibm-aix*" } { "-mcpu=G5" } { "" } } */
3 /* { dg-options "-mcpu=G5" } */
4
5 #include <signal.h>
6 #include <stdlib.h>
7
8 void
9 sig_ill_handler (int sig)
10 {
11     exit(0);
12 }
13
14
15 int  msw(long long in)
16 {
17   union {
18     long long ll;
19     int  i[2];
20   } ud;
21   ud.ll = in;
22   return ud.i[0];
23 }
24
25 int main()
26 {
27
28   /* Exit on systems without 64bit instructions.  */
29   signal (SIGILL, sig_ill_handler);
30 #ifdef __MACH__
31   asm volatile ("extsw r0,r0");
32 #else
33   asm volatile ("extsw 0,0");
34 #endif
35   signal (SIGILL, SIG_DFL);
36
37   if (msw(1) != 0)
38     abort();
39   exit(0);
40 }