libcpp, c, middle-end: Optimize initializers using #embed in C
[official-gcc.git] / gcc / testsuite / gcc.dg / vect / fast-math-bb-slp-call-2.c
blob76bb044914f462cf6d76b559b751f1338a3fc0f8
1 /* { dg-require-effective-target vect_double } */
3 #include "tree-vect.h"
5 extern long int lrint (double);
6 extern void abort (void);
7 long int a[64];
8 double b[64];
10 __attribute__((noinline, noclone)) void
11 f1 (void)
13 a[0] = lrint (b[0]) + 1;
14 a[1] = lrint (b[1]) + 2;
15 a[2] = lrint (b[2]) + 3;
16 a[3] = lrint (b[3]) + 4;
17 a[4] = lrint (b[4]) + 5;
18 a[5] = lrint (b[5]) + 6;
19 a[6] = lrint (b[6]) + 7;
20 a[7] = lrint (b[7]) + 8;
23 __attribute__((noinline, noclone)) void
24 f2 (void)
26 a[0] = lrint (b[0]);
27 a[1] = lrint (b[1]);
28 a[2] = lrint (b[2]);
29 a[3] = lrint (b[3]);
30 a[4] = lrint (b[4]);
31 a[5] = lrint (b[5]);
32 a[6] = lrint (b[6]);
33 a[7] = lrint (b[7]);
36 __attribute__((noinline, noclone)) int
37 main1 ()
39 int i;
41 for (i = 0; i < 8; i++)
43 asm ("");
44 b[i] = ((i & 1) ? -4 * i : 4 * i) + 0.25;
46 f1 ();
47 #pragma GCC novector
48 for (i = 0; i < 8; i++)
49 if (a[i] != ((i & 1) ? -4 * i : 4 * i) + 1 + i)
50 abort ();
51 else
52 a[i] = 131.25;
53 f2 ();
54 #pragma GCC novector
55 for (i = 0; i < 8; i++)
56 if (a[i] != ((i & 1) ? -4 * i : 4 * i))
57 abort ();
58 return 0;
61 int
62 main ()
64 check_vect ();
65 return main1 ();
68 /* { dg-final { scan-tree-dump-times "optimized: basic block" 2 "slp2" { target vect_call_lrint } } } */