summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ext/pr81706.C
blob: 395a81aa8c7229fe7274d014cc67a591c4159fa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// PR libstdc++/81706
// { dg-do compile { target i?86-*-* x86_64-*-* } }
// { dg-options "-O3 -mavx2 -mno-avx512f" }
// { dg-final { scan-assembler "call\[^\n\r]__?ZGVdN4v_cos" } }
// { dg-final { scan-assembler "call\[^\n\r]__?ZGVdN4v_sin" } }

#ifdef __cplusplus
extern "C" {
#endif
extern double cos (double) __attribute__ ((nothrow, leaf, simd ("notinbranch")));
extern double sin (double) __attribute__ ((nothrow, leaf, simd ("notinbranch")));
#ifdef __cplusplus
}
#endif
double p[1024] = { 1.0 };
double q[1024] = { 1.0 };

void
foo (void)
{
  int i;
  for (i = 0; i < 1024; i++)
    p[i] = cos (q[i]);
}

void
bar (void)
{
  int i;
  for (i = 0; i < 1024; i++)
    p[i] = __builtin_sin (q[i]);
}