PR libstdc++/81706
[official-gcc.git] / gcc / testsuite / g++.dg / ext / pr81706.C
blobf0ed8ab6d71104dcd0a3105fbeed32fc4a818792
1 // PR libstdc++/81706
2 // { dg-do compile { target i?86-*-* x86_64-*-* } }
3 // { dg-options "-O3 -mavx2 -mno-avx512f" }
4 // { dg-final { scan-assembler "call\[^\n\r]_ZGVdN4v_cos" } }
5 // { dg-final { scan-assembler "call\[^\n\r]_ZGVdN4v_sin" } }
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10 extern double cos (double) __attribute__ ((nothrow, leaf, simd ("notinbranch")));
11 extern double sin (double) __attribute__ ((nothrow, leaf, simd ("notinbranch")));
12 #ifdef __cplusplus
14 #endif
15 double p[1024] = { 1.0 };
16 double q[1024] = { 1.0 };
18 void
19 foo (void)
21   int i;
22   for (i = 0; i < 1024; i++)
23     p[i] = cos (q[i]);
26 void
27 bar (void)
29   int i;
30   for (i = 0; i < 1024; i++)
31     p[i] = __builtin_sin (q[i]);