2018-03-08 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr80969-4.h
bloba7ff6456242027e6771ab45fd6751ec772d229fe
2 #include <stdarg.h>
3 #include <assert.h>
5 #include "avx-check.h"
7 int a[56];
8 int b;
10 __m128 n1 = { -283.3, -23.3, 213.4, 1119.03 };
11 __m512d n2 = { -93.83, 893.318, 3994.3, -39484.0, 830.32, -328.32, 3.14159, 2.99792 };
12 __m128i n3 = { 893, -3180 } ;
13 int n4 = 324;
14 double n5 = 103.3;
15 __m128i n6 = { -123, 2 };
16 __m128d n7 = { -91.387, -8193.518 };
17 __m256d n8 = { -123.3, 2.3, 3.4, -10.03 };
18 __m128 n9 = { -123.3, 2.3, 3.4, -10.03 };
19 __m128i n10 = { 1233, -100 };
20 int n11 = 407;
21 double n12 = 304.9;
22 __m128i n13 = { 233, -110 };
23 __m256i n14 = { -1233, 23, 34, -1003 };
24 __m512i n15 = { -393, -180, 213.4, 1119.03, -8193.518, -100, 304.9, 2.99792 };
25 __m128d n16 = { 73.0, 63.18 };
26 __m256 n17 = { -183.3, -22.3, 13.9, -119.3, 483.1, 122.3, -33.4, -9.37 };
27 __m128 n18 = { -183.3, 22.3, 13.4, -19.03 };
29 __m128 e1;
30 __m512d e2;
31 __m128i e3;
32 int e4;
33 double e5;
34 __m128i e6;
35 __m128d e7;
36 __m256d e8;
37 __m128 e9;
38 __m128i e10;
39 int e11;
40 double e12;
41 __m128i e13;
42 __m256i e14;
43 __m512i e15;
44 __m128d e16;
45 __m256 e17;
46 __m128 e18;
48 static void
49 __attribute__((noinline, CALLEE_ABI))
50 bar (__m128 a1, __m512d a2, __m128i a3, va_list va_arglist)
52 e1 = a1;
53 e2 = a2;
54 e3 = a3;
55 e4 = va_arg (va_arglist, int);
56 e5 = va_arg (va_arglist, double);
57 e6 = va_arg (va_arglist, __m128i);
58 e7 = va_arg (va_arglist, __m128d);
59 e8 = va_arg (va_arglist, __m256d);
60 e9 = va_arg (va_arglist, __m128);
61 e10 = va_arg (va_arglist, __m128i);
62 e11 = va_arg (va_arglist, int);
63 e12 = va_arg (va_arglist, double);
64 e13 = va_arg (va_arglist, __m128i);
65 e14 = va_arg (va_arglist, __m256i);
66 e15 = va_arg (va_arglist, __m512i);
67 e16 = va_arg (va_arglist, __m128d);
68 e17 = va_arg (va_arglist, __m256);
69 e18 = va_arg (va_arglist, __m128);
72 void __attribute__((CALLEE_ABI))
73 (*volatile const bar_noinfo) (__m128, __m512d, __m128i, va_list) = bar;
75 static void
76 __attribute__((noinline))
77 foo (__m128 a1, __m512d a2, __m128i a3, ...)
79 va_list va_arglist;
80 int c;
82 va_start (va_arglist, a3);
83 bar_noinfo (a1, a2, a3, va_arglist);
84 va_end (va_arglist);
86 for (; b; b++) {
87 c = b;
88 if (b & 1)
89 c = 2;
90 a[b] = c;
93 void (*volatile const foo_noinfo) (__m128, __m512d, __m128i, ...) = foo;
95 static void
96 avx_test (void)
98 foo (n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12,
99 n13, n14, n15, n16, n17, n18);
100 assert (__builtin_memcmp (&e1, &n1, sizeof (e1)) == 0);
101 assert (__builtin_memcmp (&e2, &n2, sizeof (e2)) == 0);
102 assert (__builtin_memcmp (&e3, &n3, sizeof (e3)) == 0);
103 assert (n4 == e4);
104 assert (n5 == e5);
105 assert (__builtin_memcmp (&e6, &n6, sizeof (e6)) == 0);
106 assert (__builtin_memcmp (&e7, &n7, sizeof (e7)) == 0);
107 assert (__builtin_memcmp (&e8, &n8, sizeof (e8)) == 0);
108 assert (__builtin_memcmp (&e9, &n9, sizeof (e9)) == 0);
109 assert (__builtin_memcmp (&e10, &n10, sizeof (e10)) == 0);
110 assert (n11 == e11);
111 assert (n12 == e12);
112 assert (__builtin_memcmp (&e13, &n13, sizeof (e13)) == 0);
113 assert (__builtin_memcmp (&e14, &n14, sizeof (e14)) == 0);
114 assert (__builtin_memcmp (&e15, &n15, sizeof (e15)) == 0);
115 assert (__builtin_memcmp (&e16, &n16, sizeof (e16)) == 0);
116 assert (__builtin_memcmp (&e17, &n17, sizeof (e17)) == 0);
117 assert (__builtin_memcmp (&e18, &n18, sizeof (e18)) == 0);