1  /* { dg-do compile } */
       2  /* { dg-additional-options "-Wno-pedantic -Wno-long-long -m64" } */
       3  
       4  /* Vector return.  Return via pointer.  */
       5  
       6  typedef char __attribute__ ((vector_size (1))) vc1;
       7  typedef char __attribute__ ((vector_size (2))) vc2;
       8  typedef char __attribute__ ((vector_size (4))) vc4;
       9  typedef char __attribute__ ((vector_size (8))) vc8;
      10  
      11  typedef short __attribute__ ((vector_size (2))) vs1;
      12  typedef short __attribute__ ((vector_size (4))) vs2;
      13  typedef short __attribute__ ((vector_size (8))) vs4;
      14  typedef short __attribute__ ((vector_size (16))) vs8;
      15  
      16  typedef int __attribute__ ((vector_size (4))) vi1;
      17  typedef int __attribute__ ((vector_size (8))) vi2;
      18  typedef int __attribute__ ((vector_size (16))) vi4;
      19  typedef int __attribute__ ((vector_size (32))) vi8;
      20  
      21  typedef long long __attribute__ ((vector_size (8))) vll1;
      22  typedef long long __attribute__ ((vector_size (16))) vll2;
      23  typedef long long __attribute__ ((vector_size (32))) vll4;
      24  typedef long long __attribute__ ((vector_size (64))) vll8;
      25  
      26  typedef float __attribute__ ((vector_size (4))) vf1;
      27  typedef float __attribute__ ((vector_size (8))) vf2;
      28  typedef float __attribute__ ((vector_size (16))) vf4;
      29  typedef float __attribute__ ((vector_size (32))) vf8;
      30  
      31  typedef double __attribute__ ((vector_size (8))) vd1;
      32  typedef double __attribute__ ((vector_size (16))) vd2;
      33  typedef double __attribute__ ((vector_size (32))) vd4;
      34  typedef double __attribute__ ((vector_size (64))) vd8;
      35  
      36  /* { dg-final { scan-assembler-times ".extern .func dcl_rvc1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      37  vc1 dcl_rvc1 (void);
      38  /* { dg-final { scan-assembler-times ".extern .func dcl_rvc2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      39  vc2 dcl_rvc2 (void);
      40  /* { dg-final { scan-assembler-times ".extern .func dcl_rvc4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      41  vc4 dcl_rvc4 (void);
      42  /* { dg-final { scan-assembler-times ".extern .func dcl_rvc8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      43  vc8 dcl_rvc8 (void);
      44  
      45  /* { dg-final { scan-assembler-times ".extern .func dcl_rvs1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      46  vs1 dcl_rvs1 (void);
      47  /* { dg-final { scan-assembler-times ".extern .func dcl_rvs2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      48  vs2 dcl_rvs2 (void);
      49  /* { dg-final { scan-assembler-times ".extern .func dcl_rvs4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      50  vs4 dcl_rvs4 (void);
      51  /* { dg-final { scan-assembler-times ".extern .func dcl_rvs8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      52  vs8 dcl_rvs8 (void);
      53  
      54  /* { dg-final { scan-assembler-times ".extern .func dcl_rvi1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      55  vi1 dcl_rvi1 (void);
      56  /* { dg-final { scan-assembler-times ".extern .func dcl_rvi2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      57  vi2 dcl_rvi2 (void);
      58  /* { dg-final { scan-assembler-times ".extern .func dcl_rvi4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      59  vi4 dcl_rvi4 (void);
      60  /* { dg-final { scan-assembler-times ".extern .func dcl_rvi8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      61  vi8 dcl_rvi8 (void);
      62  
      63  /* { dg-final { scan-assembler-times ".extern .func dcl_rvll1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      64  vll1 dcl_rvll1 (void);
      65  /* { dg-final { scan-assembler-times ".extern .func dcl_rvll2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      66  vll2 dcl_rvll2 (void);
      67  /* { dg-final { scan-assembler-times ".extern .func dcl_rvll4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      68  vll4 dcl_rvll4 (void);
      69  /* { dg-final { scan-assembler-times ".extern .func dcl_rvll8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      70  vll8 dcl_rvll8 (void);
      71  
      72  /* { dg-final { scan-assembler-times ".extern .func dcl_rvf1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      73  vf1 dcl_rvf1 (void);
      74  /* { dg-final { scan-assembler-times ".extern .func dcl_rvf2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      75  vf2 dcl_rvf2 (void);
      76  /* { dg-final { scan-assembler-times ".extern .func dcl_rvf4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      77  vf4 dcl_rvf4 (void);
      78  /* { dg-final { scan-assembler-times ".extern .func dcl_rvf8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      79  vf8 dcl_rvf8 (void);
      80  
      81  /* { dg-final { scan-assembler-times ".extern .func dcl_rvd1 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      82  vd1 dcl_rvd1 (void);
      83  /* { dg-final { scan-assembler-times ".extern .func dcl_rvd2 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      84  vd2 dcl_rvd2 (void);
      85  /* { dg-final { scan-assembler-times ".extern .func dcl_rvd4 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      86  vd4 dcl_rvd4 (void);
      87  /* { dg-final { scan-assembler-times ".extern .func dcl_rvd8 \\(.param.u64 %\[_a-z0-9\]*\\);" 1 } } */
      88  vd8 dcl_rvd8 (void);
      89  
      90  void  test_1 (void)
      91  {
      92    dcl_rvc1 ();
      93    dcl_rvc2 ();
      94    dcl_rvc4 ();
      95    dcl_rvc8 ();
      96    
      97    dcl_rvs1 ();
      98    dcl_rvs2 ();
      99    dcl_rvs4 ();
     100    dcl_rvs8 ();
     101    
     102    dcl_rvi1 ();
     103    dcl_rvi2 ();
     104    dcl_rvi4 ();
     105    dcl_rvi8 ();
     106  
     107    dcl_rvll1 ();
     108    dcl_rvll2 ();
     109    dcl_rvll4 ();
     110    dcl_rvll8 ();
     111    
     112    dcl_rvf1 ();
     113    dcl_rvf2 ();
     114    dcl_rvf4 ();
     115    dcl_rvf8 ();
     116  
     117    dcl_rvd1 ();
     118    dcl_rvd2 ();
     119    dcl_rvd4 ();
     120    dcl_rvd8 ();
     121  }
     122  
     123  #define M(T, V) ({T t;t[0]= V;t;})
     124  
     125  /* { dg-final { scan-assembler-times ".visible .func dfn_rvc1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     126  vc1 dfn_rvc1 (void)
     127  {
     128    return M (vc1, 1);
     129  }
     130  /* { dg-final { scan-assembler-times ".visible .func dfn_rvc2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     131  vc2 dfn_rvc2 (void)
     132  {
     133    return M (vc2, 2);
     134  }
     135  /* { dg-final { scan-assembler-times ".visible .func dfn_rvc4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     136  vc4 dfn_rvc4 (void)
     137  {
     138    return M (vc4, 3);
     139  }
     140  /* { dg-final { scan-assembler-times ".visible .func dfn_rvc8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     141  vc8 dfn_rvc8 (void)
     142  {
     143    return M (vc8, 4);
     144  }
     145  
     146  /* { dg-final { scan-assembler-times ".visible .func dfn_rvs1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     147  vs1 dfn_rvs1 (void)
     148  {
     149    return M (vs1, 5);
     150  }
     151  /* { dg-final { scan-assembler-times ".visible .func dfn_rvs2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     152  vs2 dfn_rvs2 (void)
     153  {
     154    return M (vs2, 6);
     155  }
     156  /* { dg-final { scan-assembler-times ".visible .func dfn_rvs4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     157  vs4 dfn_rvs4 (void)
     158  {
     159    return M (vs4, 7);
     160  }
     161  /* { dg-final { scan-assembler-times ".visible .func dfn_rvs8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     162  vs8 dfn_rvs8 (void)
     163  {
     164    return M (vs8, 8);
     165  }
     166  
     167  /* { dg-final { scan-assembler-times ".visible .func dfn_rvi1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     168  vi1 dfn_rvi1 (void)
     169  {
     170    return M (vi1, 9);
     171  }
     172  /* { dg-final { scan-assembler-times ".visible .func dfn_rvi2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     173  vi2 dfn_rvi2 (void)
     174  {
     175    return M (vi2, 10);
     176  }
     177  /* { dg-final { scan-assembler-times ".visible .func dfn_rvi4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     178  vi4 dfn_rvi4 (void)
     179  {
     180    return M (vi4, 11);
     181  }
     182  /* { dg-final { scan-assembler-times ".visible .func dfn_rvi8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     183  vi8 dfn_rvi8 (void)
     184  {
     185    return M (vi8, 12);
     186  }
     187  
     188  /* { dg-final { scan-assembler-times ".visible .func dfn_rvll1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     189  vll1 dfn_rvll1 (void)
     190  {
     191    return M (vll1, 13);
     192  }
     193  /* { dg-final { scan-assembler-times ".visible .func dfn_rvll2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     194  vll2 dfn_rvll2 (void)
     195  {
     196    return M (vll2, 14);
     197  }
     198  /* { dg-final { scan-assembler-times ".visible .func dfn_rvll4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     199  vll4 dfn_rvll4 (void)
     200  {
     201    return M (vll4, 16);
     202  }
     203  /* { dg-final { scan-assembler-times ".visible .func dfn_rvll8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     204  vll8 dfn_rvll8 (void)
     205  {
     206    return M (vll8, 6);
     207  }
     208  
     209  /* { dg-final { scan-assembler-times ".visible .func dfn_rvf1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     210  vf1 dfn_rvf1 (void)
     211  {
     212    return M (vf1, 17);
     213  }
     214  /* { dg-final { scan-assembler-times ".visible .func dfn_rvf2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     215  vf2 dfn_rvf2 (void)
     216  {
     217    return M (vf2, 18);
     218  }
     219  /* { dg-final { scan-assembler-times ".visible .func dfn_rvf4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     220  vf4 dfn_rvf4 (void)
     221  {
     222    return M (vf4, 19);
     223  }
     224  /* { dg-final { scan-assembler-times ".visible .func dfn_rvf8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     225  vf8 dfn_rvf8 (void)
     226  {
     227    return M (vf8, 20);
     228  }
     229  
     230  /* { dg-final { scan-assembler-times ".visible .func dfn_rvd1 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     231  vd1 dfn_rvd1 (void)
     232  {
     233    return M (vd1, 21);
     234  }
     235  /* { dg-final { scan-assembler-times ".visible .func dfn_rvd2 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     236  vd2 dfn_rvd2 (void)
     237  {
     238    return M (vd2, 22);
     239  }
     240  /* { dg-final { scan-assembler-times ".visible .func dfn_rvd4 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     241  vd4 dfn_rvd4 (void)
     242  {
     243    return M (vd4, 23);
     244  }
     245  /* { dg-final { scan-assembler-times ".visible .func dfn_rvd8 \\(.param.u64 %\[_a-z0-9\]*\\)(?:;|\[\r\n\]+\{)" 2 } } */
     246  vd8 dfn_rvd8 (void)
     247  {
     248    return M (vd8, 24);
     249  }