* gcc.dg/torture/stackalign/builtin-apply-2.c: Fix skip-if syntax.
[official-gcc.git] / gcc / testsuite / gcc.dg / 20050307-1.c
blob0e8dac69a65fc1a3486f18680470458c008705bd
1 /* PR target/20322 */
3 extern void abort (void);
5 typedef unsigned long T;
6 typedef struct
8 T a, b;
9 unsigned char c, d;
10 } S;
12 #define M (sizeof (T) * 4)
14 S __attribute__((noinline))
15 foo (T x, T y)
17 S e;
18 T f[2], g;
20 e.b = (x & (~(T) 0 >> M)) * (y & (~(T) 0 >> M));
21 e.a = (x >> M) * (y >> M);
23 f[0] = (x & (~(T) 0 >> M)) * (y >> M);
24 f[1] = (x >> M) * (y & (~(T) 0 >> M));
26 g = e.b;
27 e.b += (f[0] & (~(T) 0 >> M)) << M;
28 if (e.b < g)
29 e.a++;
31 g = e.b;
32 e.b += (f[1] & (~(T) 0 >> M)) << M;
33 if (e.b < g)
34 e.a++;
36 e.a += (f[0] >> M);
37 e.a += (f[1] >> M);
38 e.c = 1;
39 e.d = 0;
41 return e;
44 int
45 main (void)
47 T x = 1UL << (M * 2 - 1);
48 S y = foo (1, x);
49 if (y.a || y.b != x || y.c != 1 || y.d)
50 abort ();
51 return 0;