2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr70499.C
blob4b8b3329d6cc1c175bebe126124a38bfb4c1dfb7
1 // { dg-do compile }
2 // { dg-additional-options "-w -Wno-psabi" }
3 // { dg-additional-options "-mavx" { target x86_64-*-* i?86-*-* } }
5 typedef double __m256d __attribute__ ((__vector_size__ (32), __may_alias__));
7 struct SIMD {
8   __m256d data;
9   SIMD() {};
10   SIMD (double val) { }
11   SIMD(__m256d _data) { data = _data; }
12   SIMD operator* (SIMD a) { return a; }
15 struct Foo {
16   SIMD val;
17   SIMD dval[2];
18   __attribute__((__always_inline__)) SIMD & Value() throw() { return val; }
19   __attribute__((__always_inline__)) Foo operator* ( const Foo & y) throw() 
20     {
21       Foo res;
22       SIMD hx;
23       SIMD hy;
24       res.Value() = hx*hy;
25       res.dval[0] = hx*hy;
26       return res;
27     }
30 template<typename Tx>  
31 __attribute__((__always_inline__)) inline void inlineFunc(Tx hx[]) {
32     Tx x = hx[0], y = hx[1];
33     Tx lam[1] = {(x*y)};
36 void FooBarFunc () {
37   Foo adp[2];
38   inlineFunc (adp);