Debian Codegraph @

gcc/testsuite/gcc.dg/torture/builtin-shufflevector-pr123156.c

raw
1 /* { dg-do run { target le } } */
2
3 #include <stdint.h>
4
5 #define BS_VEC(type, num) type __attribute__((vector_size(num * sizeof(type))))
6 #define BITCAST(T, F, arg) \
7 ((union { \
8 F src; \
9 T dst; \
10 })arg) \
11 .dst
12
13 uint64_t func_1()
14 {
15 BS_VEC(uint64_t, 32) BS_VAR_0;
16 BS_VAR_0 = BITCAST(
17 BS_VEC(uint64_t, 32), BS_VEC(uint8_t, 256),
18 __builtin_shufflevector(
19 (BS_VEC(uint8_t, 2)){ 2 }, (BS_VEC(uint8_t, 2)){}, 1, 0, 2, 2, 2, 3,
20 1, 2, 3, 1, 3, 3, 2, 1, 3, 0, 2, 2, 1, 2, 1, 3, 1, 1, 0, 0, 2, 0, 3,
21 2, 2, 0, 1, 3, 1, 2, 0, 2, 0, 3, 0, 0, 2, 0, 2, 1, 3, 2, 3, 2, 1, 1,
22 2, 3, 3, 3, 3, 0, 1, 2, 3, 2, 0, 2, 2, 2, 0, 3, 3, 3, 1, 3, 0, 0, 2,
23 3, 1, 1, 2, 2, 1, 2, 0, 0, 3, 2, 2, 3, 2, 2, 3, 2, 0, 2, 2, 0, 2, 1,
24 3, 1, 0, 2, 1, 3, 2, 1, 0, 2, 3, 0, 1, 3, 2, 1, 3, 1, 1, 3, 2, 2, 0,
25 3, 2, 2, 0, 3, 0, 3, 2, 3, 1, 3, 2, 3, 3, 2, 2, 0, 0, 0, 2, 1, 3, 1,
26 2, 2, 3, 0, 1, 3, 1, 1, 2, 0, 1, 2, 1, 2, 0, 2, 0, 2, 3, 3, 3, 1, 2,
27 0, 3, 1, 2, 0, 1, 0, 3, 0, 0, 3, 2, 2, 0, 3, 1, 2, 0, 1, 1, 3, 0, 1,
28 3, 1, 3, 2, 1, 3, 1, 2, 1, 1, 0, 1, 3, 3, 2, 3, 2, 2, 0, 2, 2, 2, 1,
29 1, 0, 3, 1, 3, 0, 3, 0, 0, 1, 3, 3, 1, 2, 1, 1, 3, 1, 0, 2, 1, 3, 2,
30 1, 3, 2, 2, 2, 3, 2, 0, 1, 3, 3, 3, 0, 0, 0, 1, 3, 2, 2, 1));
31 return BS_VAR_0[0];
32 }
33
34 int main()
35 {
36 uint64_t BS_CHECKSUM = func_1();
37 if (BS_CHECKSUM != 0x0000000000000200ull)
38 __builtin_abort ();
39 return 0;
40 }