1 /* PR target/63594 */
2 /* { dg-do run } */
3 /* { dg-options "-O2 -Wno-psabi" } */
4 /* { dg-additional-options "-mno-mmx" { target i?86-*-* x86_64-*-* } } */
5 /* { dg-prune-output "non-standard ABI extension" } */
6 
7 #define C1 c
8 #define C2 C1, C1
9 #define C4 C2, C2
10 #define C8 C4, C4
11 #define C16 C8, C8
12 #define C32 C16, C16
13 #define C64 C32, C32
14 #define C_(n) n
15 #define C(n) C_(C##n)
16 
17 #define T(t,s) \
18 typedef t v##t##s __attribute__ ((__vector_size__ (s * sizeof (t))));	\
19 __attribute__((noinline, noclone)) v##t##s				\
20 test1##t##s (t c)							\
21 {									\
22   v##t##s v = { C(s) };							\
23   return v;								\
24 }									\
25 									\
26 __attribute__((noinline, noclone)) v##t##s				\
27 test2##t##s (t *p)							\
28 {									\
29   t c = *p;								\
30   v##t##s v = { C(s) };							\
31   return v;								\
32 }									\
33 									\
34 void									\
35 test3##t##s (void)							\
36 {									\
37   t c = 17;								\
38   int i;								\
39   v##t##s a = test1##t##s (c);						\
40   for (i = 0; i < s; i++)						\
41     if (a[i] != 17)							\
42       __builtin_abort ();						\
43   v##t##s b = test2##t##s (&c);						\
44   for (i = 0; i < s; i++)						\
45     if (a[i] != 17)							\
46       __builtin_abort ();						\
47 }
48 
49 typedef long long llong;
50 
51 #define TESTS \
52 T(char, 64) \
53 T(char, 32) \
54 T(char, 16) \
55 T(char, 8) \
56 T(char, 4) \
57 T(char, 2) \
58 T(char, 1) \
59 T(short, 32) \
60 T(short, 16) \
61 T(short, 8) \
62 T(short, 4) \
63 T(short, 2) \
64 T(short, 1) \
65 T(int, 16) \
66 T(int, 8) \
67 T(int, 4) \
68 T(int, 2) \
69 T(int, 1) \
70 T(float, 16) \
71 T(float, 8) \
72 T(float, 4) \
73 T(float, 2) \
74 T(float, 1) \
75 T(llong, 8) \
76 T(llong, 4) \
77 T(llong, 2) \
78 T(llong, 1) \
79 T(double, 8) \
80 T(double, 4) \
81 T(double, 2) \
82 T(double, 1)
83 
84 TESTS
85 
86 int
main()87 main ()
88 {
89 #undef T
90 #define T(t,s) test3##t##s ();
91   TESTS
92   return 0;
93 }
94