c++: normalizing ttp constraints [PR115656]
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr106322.c
blobc05072d34162b9290822b2f748cb7b66c6179dd4
1 /* { dg-do run } */
2 /* { dg-options "-O2 -mdejagnu-cpu=power4" } */
4 /* As PR106322, verify this can execute well (not abort). */
6 #define N 64
7 typedef unsigned short int uh;
8 typedef unsigned short int uw;
9 uh a[N];
10 uh b[N];
11 uh c[N];
12 uh e[N];
14 __attribute__ ((noipa)) void
15 foo ()
17 for (int i = 0; i < N; i++)
18 c[i] = ((uw) b[i] * (uw) a[i]) >> 16;
21 __attribute__ ((optimize ("-O0"))) void
22 init ()
24 for (int i = 0; i < N; i++)
26 a[i] = (uh) (0x7ABC - 0x5 * i);
27 b[i] = (uh) (0xEAB + 0xF * i);
28 e[i] = ((uw) b[i] * (uw) a[i]) >> 16;
32 __attribute__ ((optimize ("-O0"))) void
33 check ()
35 for (int i = 0; i < N; i++)
37 if (c[i] != e[i])
38 __builtin_abort ();
42 int
43 main ()
45 init ();
46 foo ();
47 check ();
49 return 0;