Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/pr94591.c

raw
1 typedef unsigned __attribute__((__vector_size__(8))) V2SI_u;
2 typedef int __attribute__((__vector_size__(8))) V2SI_d;
3
4 typedef unsigned long __attribute__((__vector_size__(16))) V2DI_u;
5 typedef long __attribute__((__vector_size__(16))) V2DI_d;
6
7 void id_V2SI(V2SI_d *v)
8 {
9 *v = __builtin_shuffle(*v, (V2SI_d)(V2SI_u) { 0, 1 });
10 }
11
12 void id_V2DI(V2DI_d *v)
13 {
14 *v = __builtin_shuffle(*v, (V2DI_d)(V2DI_u) { 0, 1 });
15 }
16
17 extern void abort(void);
18
19 int main(void)
20 {
21 V2SI_d si = { 35, 42 };
22 id_V2SI(&si);
23
24 if (si[0] != 35 || si[1] != 42)
25 abort();
26
27 V2DI_d di = { 63, 38 };
28 id_V2DI(&di);
29
30 if (di[0] != 63 || di[1] != 38)
31 abort();
32 }