Fortran: Fix PR 47485.
[official-gcc.git] / gcc / testsuite / gcc.dg / fold-perm-2.c
blob9fd809ee296785b5d562531458f741eddb65d9ac
1 /* { dg-do compile } */
2 /* { dg-options "-O -fdump-tree-fre1" } */
3 /* { dg-additional-options "--param=riscv-two-source-permutes" { target riscv*-*-* } } */
5 typedef int veci __attribute__ ((vector_size (4 * sizeof (int))));
6 typedef unsigned int vecu __attribute__ ((vector_size (4 * sizeof (unsigned int))));
8 void fun (veci *a, veci *b, veci *c)
10 veci r1 = __builtin_shufflevector (*a, *b, 0, 5, 2, 7);
11 vecu r2 = __builtin_convertvector (r1, vecu);
12 vecu r3 = __builtin_shufflevector (r2, r2, 2, 3, 1, 0);
13 *c = __builtin_convertvector (r3, veci);
16 /* { dg-final { scan-tree-dump "VEC_PERM_EXPR.*{ 2, 7, 5, 0 }" "fre1" } } */
17 /* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "fre1" } } */