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