Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / c-c++-common / vector-subscript-4.c
blob2c2481f88b799ed31342020114e59f0447da0e86
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -w -Wno-psabi" } */
4 #define foobar(n) \
5 typedef int v##n##si __attribute__ ((vector_size (4 * n))); \
7 int \
8 foo##n(int x, v##n##si v) \
9 { \
10 v[0] ^= v[1]; \
11 return ((v##n##si)v)[x]; \
12 } \
14 int \
15 bar##n(int x, v##n##si v) \
16 { \
17 v[0] ^= v[1]; \
18 return v[x]; \
21 foobar(2)
22 foobar(4)
23 foobar(8)
24 foobar(16)
25 foobar(32)
26 foobar(64)
28 /* Verify we don't have any vector temporaries in the IL. */
29 /* { dg-final { scan-tree-dump-not "vector" "optimized" } } */