Debian Codegraph @

gcc/testsuite/g++.dg/ext/vector37.C

raw
1 // PR c++/90810
2 // { dg-do run }
3
4 void
5 foo (float x, float y)
6 {
7 typedef float __attribute__ ((__vector_size__ (4 * sizeof (float)), __may_alias__)) V;
8 const V a = { x, x, x, x }, b = { y, y, y, y };
9 const V c = a / b;
10 if (c[0] != 6.0f || c[1] != 6.0f || c[2] != 6.0f || c[3] != 6.0f)
11 __builtin_abort ();
12 }
13
14 void
15 bar (float y)
16 {
17 typedef float __attribute__ ((__vector_size__ (4 * sizeof (float)), __may_alias__)) V;
18 const V a = { 7.0f, 8.0f, 9.0f, 10.0f }, b = { 1.0f, 2.0f, 3.0f, y };
19 const V c = a / b;
20 if (c[0] != 7.0f || c[1] != 4.0f || c[2] != 3.0f || c[3] != 5.0f)
21 __builtin_abort ();
22 }
23
24 int
25 main ()
26 {
27 foo (12.0f, 2.0f);
28 bar (2.0f);
29 }