PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / pr56799.c
bloba8558ea324367d591ab92c36cdc547698f3ff31c
1 /* { dg-require-effective-target int32plus } */
3 #include <stdio.h>
4 typedef struct { int x; int y;} S;
5 extern int foo(S*);
6 int hi = 0, lo = 0;
8 int main()
10 S a;
11 int r;
12 a.x = (int) 0x00010000;
13 a.y = 1;
14 r = foo (&a);
15 if (r == 2 && lo==0 && hi==1)
17 exit (0);
19 abort ();
22 typedef unsigned short u16;
24 __attribute__ ((noinline)) int foo (S* ptr)
26 int a = ptr->x;
27 int c = 0;
28 u16 b = (u16) a;
29 if (b != 0)
31 lo = 1;
32 c += ptr->y;
34 b = a >> 16;
35 if (b != 0)
37 hi = 1;
38 c+= ptr->y;
40 c += ptr->y;
41 return c;